Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a simple macro to export a chart to Excel in xlsx format. The macro works and creates the file but when I try to open the file in Excel I get a message "Excel cannot open the file 'Temp.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."
My macro code is as follows:
sub ExcelFile
set obj = ActiveDocument.GetSheetObject("CH02")
obj.Export "C:\Temp.xlsx",","
end sub
I have read through other forum posts and tried various functions and options but without success.
Thanks
Kevin Long
Any ideas or feedback on this would be appreciated.
Thanks
Kevin
Try this:
Hi, Kevin.
Have you tried exporting as C:\Temp.xls ? I had the same problem and it worked fine with .xls.
Cheers,
Neil