DLL "class not registered" but appears in VBA Object Browser

d m 1 Reputation point
2022-01-26T21:01:16.86+00:00

I've written a C# DLL that I reference from Excel VBA. I have installed it on my machine and that of several other folks with no problems. But now I've got a client who installed it but get a "class not registered" error when they run Excel. If they go to the Excel VBA Object Browser, the my DLL shows up and all functions within are visible, but of none of the functions actually work.

I had the person with the problem manually rerun RegAsm while I watched and everything appeared to work just as it should but the error persists. I am at a loss to figure out what to try next. Any ideas would be appreciated! Thanks.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,532 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. d m 21 Reputation points
    2022-02-11T18:22:55.353+00:00

    Solved this. It turns out that that my installer program was detecting if Windows was 64-bit or 32-bit and registering the DLL appropriately. It turns out that the person having the problem was running 64-bit Windows, but 32-bit Excel. So when the DLL was called from 32-bit Excel, it thought it wasn't registered.

    The fix was very simple and proven out by testing on the target system: I just told my installer that if it detects 64-bit Windows to register the DLL using RegAsm for both 64 and 32-bit.

    4 people found this answer helpful.