RegFree .NET dll consume from VB6 and VBA
Hello guys,
I've created a dll in VB.NET to connect vb6 apps and VBA projects to Azure cloud (Application Insight) to monitor and log performance and usage of vb6 apps and VBA documents in real-time async.
Now, to be able to use it on users machines I need to run the setup or register it with regasm.
This dll is also having some referenced that it uses.
Long story short, is there a way to consume this dll with late binding but without registering in (and his references) on a user machine from vb6 apps and mainly from VBA (Excel)?
Thanks for your suggestions and advice,
Davor
Re: RegFree .NET dll consume from VB6 and VBA
Quote:
Originally Posted by
Davor Geci
Hello guys,
I've created a dll in VB.NET to connect vb6 apps and VBA projects to Azure cloud (Application Insight) to monitor and log performance and usage of vb6 apps and VBA documents in real-time async.
Now, to be able to use it on users machines I need to run the setup or register it with regasm.
This dll is also having some referenced that it uses.
Long story short, is there a way to consume this dll with late binding but without registering in (and his references) on a user machine from vb6 apps and mainly from VBA (Excel)?
Thanks for your suggestions and advice,
Davor
FYI -- Registration-Free Activation of COM Components: A Walkthrough
Re: RegFree .NET dll consume from VB6 and VBA
gyhu thanks for your response,
In this article, as I can see, they use manifest files for this RegFree approach.
But in case of VBA, we can't modify Excel, Access or Word manifest files. Is there maybe another approach?
Re: RegFree .NET dll consume from VB6 and VBA
I think that the people in the Office forum might be able to answer that one better, so I've moved the thread there, though I've also left the redirect such that it will last longer than normal.
Re: RegFree .NET dll consume from VB6 and VBA
Re: RegFree .NET dll consume from VB6 and VBA
First you need to create an assembly manifest for the .net assembly and embed it in the dll. Then you create application manifest and embed it in your VB6 exe. Look at this SO question for detailed explanation.
In VBA you have to use an activation context (an instance of Microsoft.Windows.ActCtx) instead of embeding the app manifest in Word/Excel exe.
Just load the application manifest and then call CreateObject for .net classes like this
thinBasic Code:
Set oCtx = VBA.CreateObject("Microsoft.Windows.ActCtx")
oCtx.Manifest = sFile
Set RetVal = oCtx.CreateObject(sProgID)
cheers,
</wqw>
Re: RegFree .NET dll consume from VB6 and VBA
Quote:
Originally Posted by
Davor Geci
gyhu thanks for your response,
In this article, as I can see, they use manifest files for this RegFree approach.
But in case of VBA, we can't modify Excel, Access or Word manifest files. Is there maybe another approach?
You're welcome.
Another reference for you: Reg-Free COM at runtime via Microsoft.Windows.ActCtx