Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to pre define the file name and path of the table to be excel exported.
I am able to achieve this with the piece of macro code below, but even with '.xls' specified, the file exported is a '.csv' format file !
Sub ExportExcelTable
set obj = ActiveDocument.GetSheetObject("TB01")
File = "C:\Users\Documents\Table1.xls"
obj.SaveAs= "C:\Users\Documents\Table1.xls"
obj.ActiveWorkbook.Save
Appreciate any help on the same.
Thanks.
Hi
If your data is huge, then automatically its save in CSV file format.
Edit:
Try to save in xlsx file format.
Hope it helps
Thanks for the reply.
The data to be exported is not huge at all.
Unfortunately, the code I am using doesn't work for '.xlsx' format (it opens the edit module on clicking of the action button !)
any clue ?
Hi
Please refer
Hi,
Use below code for export to csv.
sub ExportCSV()
set obj1=ActiveDocument.GetSheetObject("CH01")
obj1.Export "C:\new.csv" , ","
end sub
give ur object id and path on BOLD letters
Regards,
Bala