-
Mar 30th, 2018, 07:41 AM
#1
Thread Starter
Addicted Member
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
Last edited by Davor Geci; Mar 30th, 2018 at 10:26 AM.
My projects:
Virtual Forms
VBA Telemetry
-
Mar 30th, 2018, 11:15 AM
#2
Lively Member
Re: RegFree .NET dll consume from VB6 and VBA
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
-
Mar 30th, 2018, 12:45 PM
#3
Thread Starter
Addicted Member
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?
My projects:
Virtual Forms
VBA Telemetry
-
Mar 30th, 2018, 04:36 PM
#4
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.
My usual boring signature: Nothing
-
Mar 30th, 2018, 04:50 PM
#5
Re: RegFree .NET dll consume from VB6 and VBA
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 30th, 2018, 05:23 PM
#6
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>
-
Mar 31st, 2018, 06:16 AM
#7
Lively Member
Re: RegFree .NET dll consume from VB6 and VBA
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|