samples icon indicating copy to clipboard operation
samples copied to clipboard

COMServerDemo Sample not show in VBA

Open Alipoustdouzan opened this issue 3 years ago • 3 comments

Hey, I did everything in this address : https://docs.microsoft.com/en-us/dotnet/core/native-interop/expose-components-to-com

When i register my DLL with command below, It will show success message : regsvr32 "D:\CoreComTest\bin\Debug\netcoreapp3.1\CoreComTest.comhost.dll"

But after i open Word or Excel i can't see my dll in references.

So i download the sample in address : https://github.com/dotnet/samples/tree/main/core/extensions/COMServerDemo

I build the server project and used the command below : regsvr32 "D:\COMServerDemo\COMServer\bin\Debug\netcoreapp3.1\COMServer.comhost.dll" Like my sample it says Success, But after i tried to use it in Excel or Word still i can't see COMServer in references.

I tested both project (CoreComTest and COMServer) in .Net 5 too but still the same, Success msg in regsvr32 but not show in VBA.

Alipoustdouzan avatar Mar 13 '21 10:03 Alipoustdouzan

It is registered, but without a type library vba cannot see it. Try with CreateObject and late binding

EuroEager2008 avatar Mar 09 '23 22:03 EuroEager2008