ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   can i save an existing .xls file as a .csv file using command line (https://www.excelbanter.com/excel-discussion-misc-queries/13720-can-i-save-existing-xls-file-csv-file-using-command-line.html)

craigkan

can i save an existing .xls file as a .csv file using command line
 
I have an .xls file that I want to convert to a .csv file using the command
line. Is this possible?

Chad

Try this:

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\All Users\Desktop\Book1.csv",
FileFormat:=xlCSV


"craigkan" wrote:

I have an .xls file that I want to convert to a .csv file using the command
line. Is this possible?


craigkan

this code does not work from the command line. if i go to my excel directory
i can run C:\Program Files\Microsoft Office\OFFICE11excel.exe filename.xls
which will open filename.xls, but i can't figure out how to save this file
as .csv

"Chad" wrote:

Try this:

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\All Users\Desktop\Book1.csv",
FileFormat:=xlCSV


"craigkan" wrote:

I have an .xls file that I want to convert to a .csv file using the command
line. Is this possible?



All times are GMT +1. The time now is 02:20 AM.

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