Created
December 9, 2015 17:25
-
-
Save JamoCA/62666b5ef89ec54ef3c2 to your computer and use it in GitHub Desktop.
Visual Basic Script to convert CSV file to XLSX. (Excel is required to be installed.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'====================================== | |
'Visual Basic Script to convert CSV file to XLSX. (Excel is required to be installed.) | |
'http://stackoverflow.com/a/31606893/693068 | |
'Further customization ideas and information regarding permissions at: | |
'http://jeffkinzer.blogspot.com/2010/06/vbscript-to-convert-csv-to-xlsx.html | |
' | |
'FORMAT: CSCRIPT CSV_To_XLSX.vbs "c:\base\data.csv" | |
'(Note: CSCRIPT is required to run VBS file using the command line.) | |
'====================================== | |
Dim file, WB | |
With CreateObject("Excel.Application") | |
On Error Resume Next | |
For Each file In WScript.Arguments | |
Set WB = .Workbooks.Open(file) | |
WB.SaveAs Replace(WB.FullName, ".csv", ".xlsx"), 51 | |
WB.Close False | |
Next | |
.Quit | |
End With | |
WScript.Echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for sharing. In case you dont have Excel installed you can use an online converter