9

I have a small application which automates Microsoft Word via COM/OLE Automation.

Unfortunately this doesn't work with the virtualized Click-to-run editions of Word, because they don't have the required keys in the registry. (At least not where they are exptected to be) In other words: CreateObject fails because the necessary COM classes are not registered.

Is there any way to automate the Click-to-run editions of Microsoft Office? Perhaps some compatibility layer?

EDIT: I found just two pages where users/developers were complaining about this. Either OLE automation has become obsolete or no one is using the C2R editions...

Daniel Rikowski
  • 71,375
  • 57
  • 251
  • 329

3 Answers3

5

Unfortunately it's not possible to do automation with the Click-To-Run Office editions. It's due to the virtualization process used.

According to the information here you can switch your C2R-edition to a MSI edition. It seems like the license is the same for both editions and also the product key.

MicSim
  • 26,265
  • 16
  • 90
  • 133
  • 1
    From Office 2010 Click-to-Run compatibility with add-ins (http://support.microsoft.com/kb/982431): "Out-of-process add-ins/applications are stand-alone programs, scripts, or applications that use Office object model APIs to start functionality in the application and integrate with Office. In this case, the out-of-process application drives Office. Out-of-process applications are not supported in Click-to-Run." – Oliver Bock Feb 24 '11 at 23:31
4

It took me a few days to find this post verifying my suspicions. Microsoft really screwed this one up for anyone with an app depending on automation it seems.

For any googlers out there, the error I've been looking at in my app is:

Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80040154

I was able to resolve this by uninstalling the office click-to-run version and doing a full install.

Kendall Trego
  • 1,975
  • 13
  • 21
  • I wonder if that uninstall & re-install full (non-click-to-run) version option is available if you got Office pre-bundled with your computer (e.g., from Dell)? – Keithius Nov 16 '10 at 20:44
0

According to https://answers.microsoft.com/en-us/msoffice/forum/all/office-click-ro-run-and-ole-automation/abc2fe0d-58e4-42eb-84ef-a6e7c1c7b3f4, "I have found the solution myself. With click-to-run, Office installation does not register typelibs in HKCR\Typelib. Instead, it registers typelibs in HKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\SOFTWARE\Classes\TypeLib. VBAs running in Office is aware of the location and runs fine. External application is not aware of the location. So the solution is to run regtlib.exe on mso.dll to register Office typelibs in HKCR\Typelib so that external applications can run OLE Automation correctly."