how to automate exporting excel worksheet to csv file

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.
 
M

Michael Bednarek

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top