Hi There,
i'm trying to add an pulldown to an Excel Cell using the Vlisp add methode. The vba code for adding is like this:
With Range("e5").Validation
.Add Type:=xlValidateWholeNumber, _
AlertStyle:= xlValidAlertStop, _
Operator:=xlBetween, Formula1:="5", Formula2:="10"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from five to ten"
End With
Now i tried to translate this to VLisp like this:
(defun get:active:excel:zells( / excel ExcelWorkbook ExcelSheet ExcelCells zeile spalte)
(setq excel (vlax-get-object "excel.application")
ExcelWorkbook (if excel
(vlax-get-property excel "ActiveWorkbook")
) ;_ end of if
ExcelSheet (if ExcelWorkbook
(vlax-get-property ExcelWorkbook "ACTIVESHEET")
) ;_ end of if
ExcelCells (if ExcelSheet
(vlax-get-property ExcelSheet "CELLS")
) ;_ end of if
zeile 3
spalte 3
)
(vl-catch-all-apply
'vla-add
(list
(vlax-get-property
(vlax-variant-value (vlax-get-property ExcelCells "ITEM" zeile spalte)) "Validation")
(list "Type" 3);"xlValidateList"
(list "AlertStyle" 1);"xlValidAlertStop"
(list "Formula1" "Test1;Test2;Test3")
)
)
)
)
But this seems to be wrong. I don't know how to be the Arguments for the ADD Methode. May there is somebody who can help?
Best Regards
CADwiesel