You may encounter certain situation where Excel, Word or the interaction between the two, are causing some weird errors. One of the most generic being:
There was a problem sending the command to the program in MS Office
In my experience, this is often caused by corrupt formatting data in the registry or in the document template(s). Clearing all these settings, sometimes solve this problem.
The problems are with HKCU\Software\Microsoft\Office\<version>\<application>\Options as well as HKCU\Software\Microsoft\Office\<version>\<application>\Data – where version is the office version you have installed (i.e. 12.0 or 14.0) and the application is either word or excel.
Solving the problem
Note: Remember to close Word and Excel before you attempt this. And obviously, as always, you need to run this from an elevated command prompt.
In this example I’m just going to clear the settings for all office versions (since XP) in one go. May as well, as that just gives us a single script to run, no matter the version. And since it will just fail and move on, if the entry doesn’t exist, it doesn’t really matter.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
echo Clearing Format and Data from registry... REG DELETE "HKCU\Software\Microsoft\Office\10.0\Word\Options" REG DELETE "HKCU\Software\Microsoft\Office\11.0\Word\Options" REG DELETE "HKCU\Software\Microsoft\Office\12.0\Word\Options" REG DELETE "HKCU\Software\Microsoft\Office\14.0\Word\Options" REG DELETE "HKCU\Software\Microsoft\Office\15.0\Word\Options" REG DELETE "HKCU\Software\Microsoft\Office\16.0\Word\Options" REG DELETE "HKCU\Software\Microsoft\Office\10.0\Word\Data" REG DELETE "HKCU\Software\Microsoft\Office\11.0\Word\Data" REG DELETE "HKCU\Software\Microsoft\Office\12.0\Word\Data" REG DELETE "HKCU\Software\Microsoft\Office\14.0\Word\Data" REG DELETE "HKCU\Software\Microsoft\Office\15.0\Word\Data" REG DELETE "HKCU\Software\Microsoft\Office\16.0\Word\Data" REG DELETE "HKCU\Software\Microsoft\Office\10.0\Excel\Options" REG DELETE "HKCU\Software\Microsoft\Office\11.0\Excel\Options" REG DELETE "HKCU\Software\Microsoft\Office\12.0\Excel\Options" REG DELETE "HKCU\Software\Microsoft\Office\14.0\Excel\Options" REG DELETE "HKCU\Software\Microsoft\Office\15.0\Excel\Options" REG DELETE "HKCU\Software\Microsoft\Office\16.0\Excel\Options" REG DELETE "HKCU\Software\Microsoft\Office\10.0\Excel\Data" REG DELETE "HKCU\Software\Microsoft\Office\11.0\Excel\Data" REG DELETE "HKCU\Software\Microsoft\Office\12.0\Excel\Data" REG DELETE "HKCU\Software\Microsoft\Office\14.0\Excel\Data" REG DELETE "HKCU\Software\Microsoft\Office\15.0\Excel\Data" REG DELETE "HKCU\Software\Microsoft\Office\16.0\Excel\Data" |
Also deleting templates…
Deleting your document templates and any temporary cached versions of these, may also be a good idea.
1 2 3 4 5 6 7 8 9 10 |
del /F /Q %appData%\Microsoft\Templates\Normal.dotm del /F /Q %appData%\Microsoft\Templates\~$Normal.dotm del /F /Q %appData%\Microsoft\Templates\Normal1.dotm del /F /Q %appData%\Microsoft\Templates\~$Normal1.dotm del /F /Q %appData%\Microsoft\Templates\Normal11.dotm del /F /Q %appData%\Microsoft\Templates\~$Normal11.dotm del /F /Q %appData%\Microsoft\Word\Startup\Common.dotm del /F /Q %appData%\Microsoft\Word\Startup\~$Common.dotm del /F /Q %appData%\Microsoft\Word\Startup\common.dot del /F /Q %appData%\Microsoft\Word\Startup\~$common.dot |
Hopefully it helps.