While updating the data from AutoCAD to Excel I am getting message.
; error: Automation Error. Description was not provided.
Can anybody suggest me to overcome this
I am using AutoCAD Map 6.0 and Microsoft Excel 2002(10.2614.3501)SP-1
and I tried like this...
Code:
;----------------------------------------------------------------------------------------------------------------------;
; Routine to update data from autocad to excel.
;----------------------------------------------------------------------------------------------------------------------;
(defun C:Uv
()
(if (setq excelObj (vlax-get-object "Excel.Application"))
(if (169::ImportExcelLibrary (vlax-get-property excelObj 'Path))
(progn
(setq bookObj (vlax-get-property excelObj 'ActiveWorkBook)
sheetObj (ExcelP-get-ActiveSheet bookObj)
rangeObj (ExcelP-get-Range sheetObj "A1")
);setq
;********** Error Position**************
(ExcelP-put-Value rangeObj "Sample Text")
; error: Automation Error. Description was not provided.
(vlax-release-object sheetObj)
(vlax-release-object bookObj)
(vlax-release-object excelObj)
);progn
);if
);if
(princ)
);defun
Code:
;----------------------------------------------------------------------------------------------------------------------;
; Function to import Excel library.
;----------------------------------------------------------------------------------------------------------------------;
(defun 169::ImportExcelLibrary
(libraryPath)
(if (null(member "EXCELP-GET-ACTIVESHEET" (atoms-family 1)))
(vlax-import-type-library :tlb-filename (strcat libraryPath "Excel.exe")
:methods-prefix "ExcelM-"
:properties-prefix "ExcelP-"
:constants-prefix "ExcelC-")
T
);if
);defun
[ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]