Michael Kuzmin

personal blog

Batch convert XLSX to XLS with VBS

February16

If you have Excel 2007 installed  and you are looking for a way to convert XLSX ->XLS using windows shell (batch script, etc.) here’s the perfect solution:

1) copy this code and save it is as xlsx2xls.vbs  OR simply download it

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(Wscript.Arguments(0))
objExcel.Application.Visible = False
objExcel.Application.DisplayAlerts = False
objExcel.ActiveWorkbook.SaveAs Wscript.Arguments(1), 56
objExcel.ActiveWorkbook.Close
objExcel.Application.DisplayAlerts = True
objExcel.Application.Quit
WScript.Quit

2) in your batch script you can call it by doing this

c:\xlsx2xls.vbs "C:\inputdocument.xlsx" "C:\outputdocument.xls"

don’t mix up the order, don’t mix up file extensions, don’t mix up file paths because if you do it will overwrite your existing stuff without prompting.. and of course you will have to write this last command in one line ;-)

  
Tagged with:
| 2 Comments »

highlights

September2
  • my cat died of cancer. i loved her very very much. rest in peace.
  • i moved back to toronto. i live with irena, my best friend ^^ we just finished moving in a couple of days ago. we’ve got a couch and a dining table now. we also have a fireplace.
  • i work at a market research company in downtown toronto. when the school starts i will be working 2 or 2,5 days a week. right now i work almost every day there. im doing stats, coding and some other IT related stuff. love it.
  • it’s my last year at Glendon College. academically speaking i’ve got only 60% of  that last year’s course load left.
  • summer is over. but i love fall in toronto. especially where i live now, in midtown.
  
Tagged with:
| 1 Comment »

мда..

February16

когда я говорю себе вслух что собираюсь найти работу в финансовом секторе .. становится смешно и немного страшно

  
Tagged with:
| No Comments »