- 积分
- 11502
- 明经币
- 个
- 注册时间
- 2002-10-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2002-11-1 11:12:00
|
显示全部楼层
test
;I am also confused with these codes and I can't get
;any on-line documents about the usage of these function,
;such as msxc-****.
;
;By changing your codes a little bit, I find it work. It can
;create a new excel book and put it visible.
;
;I am using Office 97 and AuotCAD 2002. Some minor changes have
;to made if you are using diffent Office Version. And, if you
;havn't got the function vlax-get-or-create-object,
;use the vlax-get-object and vlax-create-object as you did.
(defun c:exc()
(vl-load-com)
(if (null msxc-xl24HourClock)
(vlax-import-type-library
;:tlb-filename "d:/Program Files/microsoft office/office10/XL5EN32.OLB";XL5CHS32.OLB
:tlb-filename "c:/Program Files/microsoft office/office/EXCEL8.OLB"
:methods-prefix "msxm-"
:properties-prefix "msxp-"
:constants-prefix "msxc-")
)
(setq MSX (vlax-get-or-create-object "Excel.Application.8"))
(if (/= nil MSX)
(progn
(vla-put-visible MSX :vlax-true)
(setq wbs (vlax-get-property MSX 'Workbooks))
(setq wb (msxm-add wbs))
(vlax-put-property MSX 'ScreenUpdating -1)
);progn
(princ "\nNo Microsoft Excel application found.\n")
);endif
) |
|