comma separated txt file to convert into xls format
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
‘—————- begin vbscript “csv2xls.VBS”
Set xl = WScript.CreateObject(“Excel.application”)
xl.Visible = TRUE
xl.displayalerts=False
‘paths must be FULLY QUALIFIED, esp. for INPUT files.
set book=xl.workbooks
source=wscript.arguments(0)
‘wscript.echo “trying to convert: [“+source+”]”
dest=wscript.arguments(1)
‘wscript.echo “output going to: “+dest+”.xls”
set f=book.open (source)
f.saveas dest+”.xls”,35
xl.quit
‘====== end vbscript
example call from batch:
cscript csv2xls c:\subd1\subd2\any.csv c:\converted\any
my familiarity with the excel object is “slim to none”. You might want to do more research on your own to make things work like you want.
Batch not tested, vbscript tested.
message edited by nbrane