Hello, I am looking to build a solution that converts .xls file into .csv using batch scripts and run it via the Run Command tool. Has anyone implemented a similar solution and can share the script? I attempted implementing a few scripts I found on stackoverflow but ran into errors.
Could you use a batch macro to do so? Read in each .xls file and output to a .csv?
I am looking to avoid a read/write of each file, so looking to avoid macros etc
Hi @AbhilashR
here you go
Option Explicit
Dim objExcel, objWorkbook, objFSO, objOutputFile
Dim strExcelFile, strCSVFile
strExcelFile = "C:\path\to\your\excel_file.xls"
strCSVFile = "C:\path\to\your\csv_file.csv"
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(strExcelFile)
objWorkbook.SaveAs strCSVFile, 6 '6 represents the CSV file format
objWorkbook.Close False 'False means don't save changes
objExcel.Quit
Set objWorkbook = Nothing
Set objExcel = Nothing