Can't automate Excel from Windows 10 (MFC program)

  • Thread starter Thread starter garyflet0
  • Start date Start date
G

garyflet0

Guest
I'm using Visual C++ Professional Version 2015 update 3. I have a program that automates Excel and works fine in our Windows 7 computers. However, on Windows 10, Excel doesn't even launch (CreateDispatch() returns 0).

There is a problem with a Windows Function, CLSIDFromProgID(L"Excel.Application", &clsid), which returns error 0x800401fe, which has the explanation: “Application was launched but it didn't register a class factory”. This is a curious explanation because all the function does is pick up the CLSID from the registry (it doesn’t launch Excel). And “Excel.Application” is in the registry for the Windows 10 computer just like for our Windows 7 computers. I was thinking that maybe Windows 10 doesn’t allow automation to work from clients that are from an “unknown publisher”, but then it should work with UAC off. (And when I ran it with UAC set to "never notify", the warning message did not appear when starting PI_Dats. Maybe it’s not really disabled, it just doesn’t issue the warning?)

On the Local Disk Properties Security tab, Administrators have full control and I set Users also to full control. Any ideas on how to automate Excel from Windows 10 would be greatly appreciated.

Thanks,
Gary

Continue reading...
 
Back
Top