Originally Posted by
jimmy_goodall
Firstly using "getexcel" (GetExcel ExcelFile$ SheetName$ MaxRange$)
and "getcell" (setq H30 (GetCell "H30")) etc.
These appear to be fine.
Originally Posted by
jimmy_goodall
to find the first empty cell in a column to start populating.
Once the getexcel function is passed it brings up the error "microsoft office has encountered a problem and needs to close". Then "getcell" functions as expected.
Then to write the new data into the excel file I use "openexcel" (openexcel ExcelFile$ NIL NIL)
Here's where I *beleive* you make a mistake
From GetExcel.lsp:
; OpenExcel - Opens an Excel spreadsheet
; Syntax: (OpenExcel ExcelFile$
SheetName$ Visible)
; Example: (OpenExcel "C:\\Folder\\Filename.xls"
"Sheet1" nil)
Originally Posted by
jimmy_goodall
and "putcell" (putcell DwgNameCell Title) etc.
then "closeexcel" (closeexcel ExcelFile$)
Once the openexcel function is passed. Then "putcell" functions as expected. Then "closeexcel" is passed and the error pops up again.
In the end the data is written to the file but I can not get rid of these errors. It's easy enough to click through the errors, but when running it on 50 odd drawings it would be desirable to not have these errors.
Hopefully this enough info. Any help on this would be greatly appreciated. Thanks.
Having only skimmed GetExcel.lsp, I'm not sure I understand this snippet:
Code:
...
(if (setq *ExcelApp% (vlax-get-object "Excel.Application"))
(progn
(alert "Close all Excel spreadsheets to continue!")
(vlax-release-object *ExcelApp%)(gc)
);progn
);if
(setq *ExcelApp% (vlax-get-or-create-object "Excel.Application"))
...
...If using vlax-get-or-create-object, and supplying the function an ExcelFIle$, SheetName$ arguments, I fail to understand why one would need to be alerted to "Close all Excel spreadsheets to continue"...?
Sure this *may* be needed... *if* the supplied ExcelFIle$ argument were among the already open ExcelFiles, but that is not even checked for in the LISP.
Not sure that this is your issue, but confusing to me none-the-less.