script to convert .xls to .csv in windows box

August 4, 2011 at 02:12:25
Specs: Windows XP
I have a .xls file which i need to convert to .csv file through script or a batch in windows.How can i convert the file without manual intervention

See More: script to convert .xls to .csv in windows box

Report •

August 4, 2011 at 07:10:41
Const workBookPath = "c:\path\to\file\some.xls"

With CreateObject("Scripting.FileSystemObject")
  savePath = .BuildPath(.GetParentFolderName(workBookPath), _
End With
Set workBook = GetObject(workBookPath)
For Each sheet In workBook.Worksheets
  sheet.SaveAs savePath & "." & sheet.Name & ".csv", 6
Next 'sheet
workbook.Close False
WScript.Echo "Done"

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question