chenning
07-18-2003, 08:20 AM
I am trying to save an excel file as a .csv through VB code. This file is being used to impot into a database. When I save the file manually as a .csv, the import runs fine, but when I save it as a .csv through VB code, the import doesn't run.
Any suggestions would be helpful.
Thanks
matstuff
07-18-2003, 08:27 AM
how are you saving the .csv manually? show us the code...
chenning
07-18-2003, 08:59 AM
how are you saving the .csv manually? show us the code...
By manually, I mean opening the excel file, and goin to File, Save As, select the csv file type, and click the save button.
matstuff
07-18-2003, 09:06 AM
I am trying to save an excel file as a .csv through VB code. This file is being used to impot into a database. When I save the file manually as a .csv, the import runs fine, but when I save it as a .csv through VB code, the import doesn't run.
Any suggestions would be helpful.
Thanks
"when I save it as a .csv through VB code"
How are you saving it there? Have you looked at the .csv file that excel creates in notepad and compared how it looks relative to the file that you create in code?
Agent707
07-18-2003, 09:46 AM
I thought I posted a reply earlier? hmmm... :-\
Wouldn't this work?
ActiveWorkbook.SaveAs Filename:= "C:\Book1.csv", FileFormat:=xlCSVMSDOS, CreateBackup:=False