View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Need Automation Help fast

That is exactly what Jim and I (Bob) assumed when we gave the advice we did.
xlCSV is part of the Excel type library, and if you don't have a reference
to Excel, that constant doesn't exist in your project, hence the error. Our
advice will work, but of course there may be others.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Perico" wrote in message
...
Thanks Phil and Jim for the help. I'll give it a try. Before reading
your
notes I noticed that b/c I'm using late binding, I didn't have a reference
set to Excel in the Access vba References dialogue. (I learned earlier
that
when I set a reference to Excel in the Access vba references dialogue box,
other parts of my automation routine did not work.) In testing the
"FileFormat:=xlCSV" issue, I then set a reference to Excel in the dialogue
and the saveas csv did work. However, as I say, setting a reference in
the
dialogue box creates problems elsewhere in the automation operation, so
I'm
hoping you recommendation works.

"Bob Phillips" wrote:

Use the value 6 instead of xlCSV.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Perico" wrote in message
...
I'm running this code FROM ACCESS using automation to run Excel. Am
trying
to save the Excel file I create as a csv, but the xlCSV is not
recognized:

xlWbMst.SaveAs Filename:=fNameMst, FileFormat:=xlCSV

How do I save my Excel file as a true csv file running the code in
Access
using automation if the above does not work. Need help quickly please.