Subject: how to create combo box in excel sheet through lotus script
You’re lucky there’s no longer a link to the forum FAQs, or I’d flame you so-o-o bad…
Look at the VB/VBA code you are copying from. It doesn’t say:
.Add Type=xlValidateList ,AlertStyle=xlValidAlertStop, Operator= _
xlBetween, Formula1=“aa,bb,cc,dd”
IgnoreBlank = True
InCellDropdown = True
InputTitle = “”
ErrorTitle = “”
InputMessage = “”
ErrorMessage = “”
ShowInput = True
ShowError = True
but this:
.Add Type:=xlValidateList ,AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=“aa,bb,cc,dd”
IgnoreBlank := True
InCellDropdown := True
InputTitle := “”
ErrorTitle := “”
InputMessage := “”
ErrorMessage := “”
ShowInput := True
ShowError := True
Note that the “:=” operator is used to assign values to the input arguments. That means that you can use the arguments in any order you want and don’t need to give values to any arguments you aren’t using. LotusScript doesn’t have a “:=” operator, so you need to find out FROM THE DOCUMENTATION what arguments are used by the .Add method and in what order they should appear. Your LS version will end up looking something like this:
.Add xlValidateList, xlValidAlertStop, xlBetween, “aa,bb,cc,dd”, True, True, “”, “”, “”, “”, True, True
DO NOT use that as the final code – I have no idea what order the arguments need to occur in, and since this is YOUR problem, you’ll need to look at the documentation yourself to find out what goes where. You can’t skip any arguments between the first argument (always required) and the last one you use. If there are optional arguments in the list, you’ll need to use a comma to indicate that you are skipping one:
.Add(1, “Hi there”, True, True, , , False, 42, “Goodbye”)
Can you see where two optional values have been skipped?
Note, too, that several MS Excel VBA constants are being used (xlValidateList, xlBetween, etc.). LotusScript is unaware of VBA built-in constants – you need to find out what the values are.