/vbScript/xlstocsv.vbs

https://bitbucket.org/shiva_dev/radials_app · Visual Basic · 11 lines · 11 code · 0 blank · 0 comment · 1 complexity · 177a8d09d34170736180fb7abad5ccac MD5 · raw file

  1. if WScript.Arguments.Count < 2 Then
  2. WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
  3. Wscript.Quit
  4. End If
  5. Dim oExcel
  6. Set oExcel = CreateObject("Excel.Application")
  7. Dim oBook
  8. Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
  9. oBook.SaveAs WScript.Arguments.Item(1), 6
  10. oBook.Close False
  11. oExcel.Quit