Need some help.. I have a VBA class module in MS ACCESS. In the same MS ACCESS app, I am calling a .NET DLL (which i have exposed as COM-visible) and passing BYREF an instance of the VBA class module as an argument to one of the .NET DLL method. Step by step, here's what i am doing:
1. Create vba class module in MS ACCESS
Option Compare Database
Option Explicit
...
Public Function DoSomething(ByV al S as String, ByRef RetVal as Double) As Long
RetVal = 100End Function
DoSomething = 0
2. Create a .NET DLL and expose it as COM
Public Class COMClass
Public Function UseVBAClassAndD oSomething(ByVa l S as String, ByRef VBAClass as Object, ByRef RetVal as double) as IntegerEnd Class
Dim R as DoubleEnd Function
VBAClass.DoSome thing("anything ", R)
RetVal = R + 10
UseVBAClassAndD oSomething = 0
3. From MS ACCESS, CreateObject .NET DLL and pass a reference of the above class (say call it Class1) to a method in the .NET DLL
Dim C as Class1
Dim R as Double
Dim O as Object
Set C = New Class1
Set O = CreateObject("M yNETDLL.COMClas s")
Msgbox O.UseVBAClassAn dDoSomething("j ust a string", C, R)
Set O = Nothing
Set C = Nothing
It works as intended but when the MS ACCESS app closes, MS ACCESS process is still runnning and you cannot close MS ACCESS.exe (unless you goto Taskbar and kill the process).
Has anyone experienced the same? How did you resolve this? Thanks in advance