View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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.