- (defun c:tt(/ CAD DIR DOC EXCEL WORKBOOKS X XLS)
- (setq cad(vlax-get-acad-object))
- (setq doc(vla-get-ActiveDocument cad))
- (setq dir(vl-filename-directory(vlax-get doc 'FullName)))
- (setq xls(vl-directory-files dir"*.xls*"1));xls文件列表
- (setq excel(vlax-get-or-create-object "excel.application"))
- (setq xls(mapcar'(lambda(x)(strcat dir "\\"x))xls))
- (vla-put-visible excel 1)
- (if excel
- (progn
- (setq Workbooks(vlax-get-property excel 'Workbooks))
- (foreach x xls(vlax-invoke-method WorkBooks 'Open x))
- )
- (list(alert"未安装excel")(exit)))
- (prompt"***大懒猪荣誉出品***")
- (princ)
- )
|