ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Automation Help fast (https://www.excelbanter.com/excel-programming/380190-re-need-automation-help-fast.html)

Bob Phillips

Need Automation Help fast
 
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.





Bob Phillips

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.








Perico[_2_]

Need Automation Help fast
 
You advice solved my problem "fast". Thanks again.

"Bob Phillips" wrote:

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.









Bob Phillips

Need Automation Help fast
 
You might want to try this little technique
http://www.xldynamic.com/source/xld.EarlyLate.html

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Perico" wrote in message
...
You advice solved my problem "fast". Thanks again.

"Bob Phillips" wrote:

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.












All times are GMT +1. The time now is 11:27 AM.

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