how to automate exporting excel worksheet to csv file

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Looking for a way to create a macro or script to export the contents of an
excel
spreadsheet ( 6columns) to an ASCII comma separated file.
I would like to be able to script this to run weekly.
 
Looking for a way to create a macro or script to export the contents of an
excel
spreadsheet ( 6columns) to an ASCII comma separated file.
I would like to be able to script this to run weekly.

With VBA, I would do it this way:
someWorkBook.SaveAs Filename:=someFilename, FileFormat:=xlCSV

As to running it weekly: Create and schedule a VB script which runs
Excel, opens the workbook, runs the code above. Like this:

Dim objXL
Const xlCSV = 6

Set objXL = WScript.CreateObject("Excel.Application")

objXL.WorkBooks.Open "your.XLS"
objXL.DisplayAlerts = False
objXL.WorkBooks("your.XLS").SaveAs "your.CSV", xlCSV
objXL.Quit
Set objXL = Nothing
 
Back
Top