Here’s a VBScript that will change an Excel 2007/2010 .xlsx file into an .xls or .csv file with a drag and drop:
- Dim fileName
- Dim oExcel
- fileName = WScript.Arguments(0)
- newFileName = left(fileName, len(filename) -4) & "xls"
- '* to save as CSV:
- '* newFileName = left(FileName, len(fileName) -4) & "csv"
- set oExcel = CreateObject("Excel.Application")
- oExcel.Workbooks.Open fileName, False, True
- oExcel.ActiveWorkbook.SaveAs newFileName,56 '* 56 = xExcel8
- '* to save as CSv:
- '*' oExcel.ActiveWorkbook.SaveAs newFileName, 6
- oExcel.ActiveWorkbook.Close False
- oExcel.quit
- set oExcel = nothing
It’s a fast way to convert a file for email or an ETL process when you’re not already in Excel.