In the worst case, you can utilise the type library -
(setq ImportExcelTypeLibrary ; did ya know that, "Excel.exe" is the type library, thats why "Excel.olb" doesn't exist
(lambda ( / IName ICLSID IServer tlb )
; http://www.theswamp.org/index.php?topic=53368.msg580916#msg580916
; http://www.theswamp.org/index.php?topic=53389.msg581045#msg581045
(or xlm-AccrInt ; User warning: assignment to protected symbol: xlm-AccrInt <- #<SUBR @0000005022ddfd68 nil>
(and
(setq IName "Excel.Application")
(setq ICLSID (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" IName "\\CLSID")))
(setq IServer (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\CLSID\\" ICLSID "\\LocalServer32")))
(setq tlb (findfile (vl-string-right-trim "\/automation" IServer)))
(vlax-import-type-library
:tlb-filename tlb
:methods-prefix "xlm-"
:properties-prefix "xlp-"
:constants-prefix "xlc-"
); vlax-import-type-library
); and
); or
); lambda
); setq ImportExcelTypeLibrary
(ImportExcelTypeLibrary)
(setq ExcelConstants ; Inspect'n'pretty print, or use assoc
(apply (function append)
(mapcar (function (lambda (x) (if (wcmatch (vl-symbol-name x) "xlc-*") (list (list x (eval x)))))) (atoms-family 0))
)
)
;|
(assoc 'xlc-xlCalculationAutomatic ExcelConstants) >> (xlc-xlCalculationAutomatic -4105)
(assoc 'xlc-xlCalculationManual ExcelConstants) >> (xlc-xlCalculationManual -4135)
|;
Although it won't be so comfortable as using the Object browser.
FWIW, for the rest MS Office applications -
(setq ImportMSOTypeLibraries
(lambda nil
(mapcar
(function
(lambda (x f / tlb)
(or (eval f)
(if (findfile (setq tlb (strcat "C:\\Program Files\\Microsoft Office\\Office15\\" (strcase x) ".OLB")))
(progn
(setq x (substr x 1 3))
(vlax-import-type-library
:tlb-filename tlb
:methods-prefix (strcat x "-m-")
:properties-prefix (strcat x "-p-")
:constants-prefix (strcat x "-c-")
); vlax-import-type-library
); progn
); if
); or
); lambda
); function
'("MSWord" "MSAcc" "MSOutl" "MSPpt") ; Word, Access, Outlook, PowerPoint
'(MSW-m-Accept MSA-m-Add MSO-m-Activate MSP-m-Activate) ; The very first User warning: assignment to protected symbol
); mapcar
); lambda
); setq ImportMSOTypeLibraries
; (ImportMSOTypeLibraries)
;|
(assoc 'PowerPoint MSOconstants)
(assoc 'Word MSOconstants)
(assoc 'Outlook MSOconstants)
|;
(setq MSOconstants
(
(lambda ( / L n )
(foreach x (apply (function append) (mapcar (function (lambda (x) (if (wcmatch (vl-symbol-name x) "MS@-c-*") (list x)))) (atoms-family 0)))
(if (setq n (vl-position (substr (vl-symbol-name x) 3 1) '("W" "A" "O" "P")))
(progn
(setq x (list x (eval x)))
(setq L
(cons
(nth n
(list
(list x nil nil nil)
(list nil x nil nil)
(list nil nil x nil)
(list nil nil nil x)
)
)
L
)
); setq L
); progn
); if
); foreach
(setq L (mapcar (function (lambda (x) (vl-remove nil x))) (apply 'mapcar (cons 'list L))))
(mapcar 'cons '(Word Access Outlook PowerPoint) L)
)
)
); setq MSOconstants