In this example we are converting a file called MyFile.xls in the temp directory to MyFle.xlsx in the same temp directory. I didn't have any luck getting this to work without using absolute path.
- Open a command prompt
- Execute the following (after adjusting it to meet your specific environment:
"C:\Program Files\Microsoft Office\Office14\excelcnv.exe" -oice "C:\temp\MyFile.xls" "C:\temp\MyFile.xlsx"
Since this is command line driven you can script many files easily.
@ECHO OFF
FOR %%X in (".\*.xls") DO IF NOT %%~xX == .xlsx echo Converting "%%~dpnxX" & "C:\Program Files\Microsoft Office\Office14\excelcnv.exe" -nme -oice "%%~dpnxX" "%%~dpnX.xlsx"
WARNING: For some reason Excel may tell you that it didn't launch correctly and ask you if you want to run it in safemode. I have no clue as to why this is, but clicking No each time seems to work fine. It will do this for each file.
9 comments:
Brent,
Did you ever find a solution to Safe Mode popup message?
Hi - did you ever found a solution for safe mode popup? I am automating the conversion and dont know how I can suppress the popup or choose a default. Any inputs?
Hi! Thank you for this instruction, it was very helpful.
And i have found a way to remove safe mode error!
After every use of excelcnv you need to remove registry key by using "reg delete HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Excel\Resiliency\StartupItems /f"
(change version in "\15.0\" to your version)
Excellent, thanks for the registry key fix makes converting large numbers of files a breeze now.
Thanks !! This helped me a lot!!
Can the excelcnv.exe file be copied from a PC that has it to another PC (Has Excel 2007 on it) and used as described?
Thanks,
Thanks! This really helped me :)
What does the -oice do? I've also seen -nme also without explanation.
Here is what you could use as well https://freetools.site/document-converters/xls-to-xlsx
Post a Comment