Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Q: How to code Excel Data Validate pulldown in FoxPro?

Status
Not open for further replies.

ctbaker

Programmer
May 8, 2003
26
US
I have a foxpro program which opens excel and creates a spreadsheet, populates it with data and then does some formatting. I am also trying to build some pulldown selection boxes (Data -> Validation to make it in Excel).

Please see the snippet of FoxPro code we have written below. The .ADD line is giving us an error. Does anyone know the correct conversion from the Excel code (see code snippet at bottom of post) to FoxPro code?

Thank you!
Chad

WITH xlapp.Selection.Validation
.Delete
.Add(1,1,1,"=$AU$1:$AY$1") && This is my quess of a FoxPro conversion of the Excel macro code.
.IgnoreBlank = .T.
.InCellDropdown = .T.
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = .F.
.ShowError = .T.
EndWith

The corresponding excel code is:

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=$AU$1:$AY$1"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = False
.ShowError = False
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top