Resolved Excel cant seem to find my comhost.dll

SilverShaded

Well-known member
Joined
Mar 7, 2020
Messages
93
Programming Experience
10+
On my main machine, my .Net Core 6 functions work via a comhost.dll / tlb in Excel with no problems. They work if i just manually register it via Power Shell using Regsvr32 inside of visual studio. I can then create a SetUp project and install it on my main machine and that also works, i can use the functions in the DLL from Excel with no problems.

Now the problems start when i install it on another machine, firstly I have to install .Net Core 6 or it fails to register the dll. After installing .Net 6 it installs with no complaints. However when i now start Excel (and referrnce the appropriate TLB file) the functions do not work. The VBA just stops when it should be calling the COM DLL.

I have also tried manually registering the COMHost.DLL which registers ok, but it does not help.

I'm clearlry missing something but have no idea what it could be, can't find any help by googling either. Any ideas? (all the other machines i have tried it on are VMs, don't know if that would make any difference).
 
I though that with .NET 6, TLBs can now be embedded. Anyway, it maybe worth going through the steps listed in the MS documentation to make sure you've got everything covered:

Have you looked the Windows Event log to see if there are any clues?

On the other machine, is it running the 64-bit or 32-bit version of Excel? If the 32-bit, you'll need to build a comhost.dll that is targeted for 32-bit rather than the default 64-bit.
 
I though that with .NET 6, TLBs can now be embedded. Anyway, it maybe worth going through the steps listed in the MS documentation to make sure you've got everything covered:

Have you looked the Windows Event log to see if there are any clues?

On the other machine, is it running the 64-bit or 32-bit version of Excel? If the 32-bit, you'll need to build a comhost.dll that is targeted for 32-bit rather than the default 64-bit.
Ok thanks, i forgot you could embed the tlb which is much neater. Yes it was a combination of various things on different pcs, not having the right framework, excel 32 bit etc etc, all sorted now, thanks for the prompts.
 
Last edited:
Back
Top Bottom