Link to home
Start Free TrialLog in
Avatar of mykapa
mykapaFlag for Lithuania

asked on

handle C# events in vb6 (VBA)

I have created component (.net dll), and I want to use in Access. Everything works fine, but I have problems handling events from that component.

I need an example where vb responds to events from .net assembly
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mykapa

ASKER

Thanks, for reply. I changed .net component and vb code according to the article in MSDN.

Now I have another problem :

Public WithEvents rptObject As MyReport

Private Sub Class_Initialize()
  Dim o As Object
  Set o = New MyReport
  Set rptObject = o            <--- error - Method 'rptObject' of object 'clsAccess2XLSReport'
End Sub

Then I tried to use this in form module, the same way, I got an error: Automation error. The system cannot find the file specified.

P.S. When I delete the keyword WithEvents, everything works fine, but ... without events :(
Avatar of mykapa

ASKER

The problem was that I had to put my component dll in Access directory, then everything works. Thanks