Hello everyone,
I have a subrutin to open an Excel file and add some changes into it, it works well when the excel file is visible, but changes not saved after closing it by using programmatically :
(setq f "D:\\262.csv")
(setq excel (vlax-get-or-create-object "Excel.Application"))
(vla-put-visible excel :vlax-true)
(setq workbooks (vlax-get-property excel 'workbooks))
(setq currworkbook (vlax-invoke-method workbooks 'open f))
(setq xlsheets (vlax-get-property currworkbook "Sheets"))
(setq xlsht (vlax-get-property xlsheets 'item 1))
(vlax-put-property xlsht 'name "Points")
(setq xlrng (vlax-get-property xlsht 'usedrange))
(setq xlcol (vlax-get-property xlrng 'columns))
(vl-catch-all-apply
'vlax-invoke-method
(list xlcol 'autofit)
)
(vlax-invoke-method workbooks 'Close :vlax-true)
(vlax-release-object workbooks)
(vlax-invoke-method excel 'Quit)
(vlax-release-object excel)
)
My aim is to open Excel file in a hidden way then making the changes and finally closing it automatically.