• PowerPoint COM Interop – Cannot create ActiveX component

    Home » Forums » Developers, developers, developers » Other MS software – .NET, Runtimes » PowerPoint COM Interop – Cannot create ActiveX component

    Author
    Topic
    #2636347

    I am writing this to document my experience in case anyone else has the same problem.

    On February 8, I was working on a .NET Framework 4.8.1 app that uses CreateObject to instantiate PowerPoint.Application. The app worked fine when I quit for the day.

    As I went to shutdown my PC for the night, Windows Update told me that I had to restart because an update had been installed.

    These updates were installed by Windows Update on Feb 8, 2024.
    2024-01 Cumulative Update for Windows 11 Version 23H2 for x64-based Systems (KB5034123)
    2024-01 Cumulative Update for .NET Framework 3.5 and 4.8.1 for Windows 11, version 23H2 for x64 (KB5033920)
    2024-01 .NET 6.0.26 Security Update for Client (KB5033733)

    On the morning of Feb 9, I started up my PC then opened Visual Studio and started my app to do some more testing. The CreateObject statement in the app failed – “cannot create ActiveX component.”

    After much troubleshooting, I solved the problem by uninstalling and re-installing Office 2019.

    Viewing 2 reply threads
    Author
    Replies
    • #2636599

      After more testing, I discovered the “real” root cause.

      When testing using Visual Studio, whether in DEBUG or RELEASE, if Visual Studio is in Admin mode, creating a COM Interop component fails. I don’t know why.

      When I end Visual Studio and start it in non-Admin mode, creating the COM Interop component works fine. When I start Visual Studio in Admin mode, creating the COM Interop component fails.

      Hope this helps someone!

    • #2636623

      For what it’s worth, a COM server’s classes must be registered per-machine (HKLM) not per-user (HKCU) if they are to be instantiated by an elevated COM client. This is a security mechanism built into COM since HKLM registration requires Administrator privileges.

    • #2636628

      Thanks for that info. I am using PowerPoint COM Interop. It was automatically registered during the installation of Microsoft Office.

    Viewing 2 reply threads
    Reply To: PowerPoint COM Interop – Cannot create ActiveX component

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: