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
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"
.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