View Single Post
Newbie Member
25Jun2009,16:13  
wiere's Avatar
Realised used this site quite a lot without ever giving back to it, so i thought i'd change that.

This script is nice and simple way of converting xls to csv simply drag the files onto the vbs to use.

Code:
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1

    FullName = objArgs(I)
    FileName = Left(objArgs(I), InstrRev(objArgs(I), ".") )

    Set objExcel = CreateObject("Excel.application")
    set objExcelBook = objExcel.Workbooks.Open(FullName)

    objExcel.application.visible=false
    objExcel.application.displayalerts=false

    objExcelBook.SaveAs FileName & "csv", 23

    objExcel.Application.Quit
    objExcel.Quit   

    Set objExcel = Nothing
    set objExcelBook = Nothing

Next