ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   fileformat not working with Object (https://www.excelbanter.com/excel-programming/311535-fileformat-not-working-object.html)

Nancy[_4_]

fileformat not working with Object
 
I created a macro in Word to invoke Excel file and save
the excel file as CSV format. The Excel file can be
opened with no problem, it just won't saved in CSV
format. I created the same macro in Excel, it works. I
don't know why it doesn't work in Word.

Tom Ogilvy

fileformat not working with Object
 
I would guess you are using late binding and using code like

fileformat:=xlCSV

with late binding, xlCSV is not defined, so it equals 0. You need to use
the hardcoded value.

? xlcsv
6

so
fileformat:=6

--
Regards,
Tom Ogilvy

"Nancy" wrote in message
...
I created a macro in Word to invoke Excel file and save
the excel file as CSV format. The Excel file can be
opened with no problem, it just won't saved in CSV
format. I created the same macro in Excel, it works. I
don't know why it doesn't work in Word.





All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com