Skip to content

Instantly share code, notes, and snippets.

@Opiprog
Created December 6, 2016 12:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Opiprog/8bb6f491578d4f23540ccd98e85288c3 to your computer and use it in GitHub Desktop.
Save Opiprog/8bb6f491578d4f23540ccd98e85288c3 to your computer and use it in GitHub Desktop.
Convert xls to xlsx using Windows cmd
# Open a command prompt in windows and type the following
# This open the excelcnv.exe from the Office15 folder and converts MyFile.xls (from the in folder) to MyFile.xlsx (to the out folder)
"C:\Program Files (x86)\Microsoft Office\Office15\excelcnv.exe" -oice "C:\in\MyFile.xls" "C:\out\MyFile.xlsx”
@RoryOT
Copy link

RoryOT commented Jul 31, 2019

Would there be any way to configure this to look at multiple files, i.e. using a wildcard, *.xls??

@Nefcanto
Copy link

Nefcanto commented Jan 2, 2020

Not working for me. The command gets executed and nothing is printed out and no file is produced. Using Office16 here.

@aprojanos71
Copy link

The syntax is
"C:\Program Files (x86)\Microsoft Office\Office15\excelcnv.exe" -oice "C:\in\MyFile.xls" "C:\out\MyFile.xlsx
The " at the end of the text is not necessary

@dinesh010595
Copy link

I need to convert xlsx to xlsb please suggest, I am trying with just changing the extention, it converting the file but data is corrupted

@Danimal1
Copy link

Danimal1 commented Apr 22, 2022

The 0365 Version... works with or without the trailing quote for me... Great job!
"C:\Program Files (x86)\Microsoft Office\root\Office16\excelcnv.exe" -oice "C:\Users\dbarry\Desktop\Staff.xls" "C:\Users\dbarry\Desktop\Staff.xlsx https://gist.github.com/Nefcanto @Nefcanto give this a try if this is still an issue.. or let me know if you have a better solution.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment