Announcement

Collapse
No announcement yet.

Launching Excel From NSIS Finish Page Gives Class not registered Error For Admin User

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Launching Excel From NSIS Finish Page Gives Class not registered Error For Admin User

    Hi,

    I am experiencing a strange occurrence when installing for a Standard user versus Admin.

    My installer requests "Highest" authentication level then proceeds to register COM dlls using a registry file import to HKCU (instead of using regasm.exe directly). The COM is for use in VBA in Excel. This allows me to install on a per-user basis.

    After installation I have the "Run app" checkbox checked on the Finish page. The process is:

    1. The user clicks "Finish" and NSIS launches a VB.net exe I wrote
    2. The VB.net exe writes some additional registry entries to HKCU (that don't have anything to do with COM) then launches Microsoft Excel
    3. Excel opens and attempts to instantiate the COM object in VBA.

    Here is the strange difference:

    1. For the "Standard" user this all works perfectly.

    2. For the "Admin" user I get:

    Run-time error '-2147221164 (80040154':

    Class not registered

    Curiously, if I then close Excel and double-click the desktop shortcut Excel opens and instantiates the object for the Admin user with no problem.

    So, effectively, this error only occurs for the Admin user during the initial installation process (e.g. when it is NSIS that launches the VB.net exe which then launches Excel).

    This problem occurs both on Windows 10 64-bit with Office 365 64-bit as well as Window 10 32-bit with Office 365 32-bit. So, the bitness of the applications has nothing to do with it.

    It's almost like the registry isn't "refreshing" for the Admin user during the initial installation.

    Any ideas as to what is going on and what the code is to fix it?

    Matthew

  • #2
    Please don't ask the same question on multiple sites at the same time.

    UAC elevated COM does not read HKCU.
    IntOp $PostCount $PostCount + 1

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎