views:

29

answers:

1

Hi all,

I have a third-party legacy software that uses Automation to control MS Excel (using MFC/C++). The code is straightforward:

_ApplicationPtr xl;
HRESULT hr = xl.CreateInstance("Excel.Application");

This worked perfectly since Excel 2000, 2002 (XP), 2003 and 2007; however, after installing Office 2010, the CreateInstance call fails with "Invalid Class String" (CO_E_CLASSSTRING). Is there anything special I need to do to get this to work?

Thanks in advance!

A: 

The class string is the "Excel.Application" part, which, presumably, Microsoft has changed in Office 2010.

Normally, it's something like "Excel9.Application" for the "real" value, and "Excel.Application" pointing to the latest version specific entry. It's possible the MS stopped adding the pointer entry, or your registry got messed up in the upgrade.

James Curran
JoJoeDad
JoJoeDad