Xls to Xlsx LISP updation

Xls to Xlsx LISP updation

Yamishon_Noah
Enthusiast Enthusiast
1,289 Views
3 Replies
Message 1 of 4

Xls to Xlsx LISP updation

Yamishon_Noah
Enthusiast
Enthusiast

Hi

 

I have attached lisp working with *.XLS files.

is it possible to update lisp to work with *.XLSX ?

 

 

Thanks

 

Yamishon

 

 

XlsXls

 

0 Likes
1,290 Views
3 Replies
Replies (3)
Message 2 of 4

patrick_35
Collaborator
Collaborator

Hi

 

Yes, you change "xls" by "xlsx" or "xlsx;xls"

For example

(getfiled " Select Excel File" Pathname$ "xlsx;xls" 20)


@+

Message 3 of 4

Yamishon_Noah
Enthusiast
Enthusiast

Thanks Patrick

 

Now it is enabled me to select *.xlsx file but lisp is unable to read the file..

 

Please let me know, what else should I change with it?

 

Yamishon

0 Likes
Message 4 of 4

patrick_35
Collaborator
Collaborator

Normally, you have nothing to do because you call Excel

(setq ExcelApp% (vlax-get-object "Excel.Application"))

So for him, opening an xls or xlsx file makes no difference.

 

An example to open an Excel file

(setq xl (vlax-get-or-create-object "Excel.Application"))
(setq file (findfile "My_File.xlsx"))
(vla-put-visible xl :vlax-true)
(setq wks (vlax-get xl 'Workbooks))
(setq xls (vlax-invoke wks 'open file))

@+