i have written following code convert xlsx file csv format:
if wscript.arguments.count < 2 wscript.echo "error! please specify source path , destination. usage: xlstocsv sourcepath.xls destination.csv" wscript.quit end if dim oexcel set oexcel = createobject("excel.application") dim obook set obook = oexcel.workbooks.open(wscript.arguments.item(0)) obook.saveas wscript.arguments.item(1), 6 obook.close false oexcel.quit
it working fine when giving server path xlsx file. but, when giving local machine path, giving me following error:
file not found. check spelling of file name, , verify file location correct. if trying open file list of used files, make sure file has not been renamed, moved or deleted
code: 800a03ec
source: microsoft office excel
if still getting error, simple echo on both arguments make sure doing should doing
wscript.echo "arg(0): " & wscript.arguments.item(0) & " arg(1): " & wscript.arguments.item(1)
also if using cscript.exe run it, default looking files in c:\windows\system32\ directory
Comments
Post a Comment