 - (defun c:tt(/ path filename)
- (setq path (getvar "DWGPREFIX"))
- (setq filename (strcat path "工程材料统计.xls"))
- (DSX-Open-Excel-Exist filename "show")
- )
- (defun DSX-Open-Excel-Exist (xfile dmode / appsession)
- (princ "\n打开 Excel 电子表格文件...")
- (cond
- ( (setq fn (findfile xfile))
- (cond
- ( (setq appsession (vlax-get-or-create-object "Excel.Application"))
- (vlax-invoke-method
- (vlax-get-property appsession 'WorkBooks)
- 'Open fn
- )
- (if (= (strcase dmode) "SHOW")
- (vla-put-visible appsession 1)
- (vla-put-visible appsession 0)
- )
- )
- )
- )
- ( T (alert (strcat "\n不能找到指定的文件: " xfile)) )
- )
- appsession
- )
函数是收集的,不清楚原作者是谁
|