handle C# events in vb6 (VBA)

Posted on 2004-11-04
Last Modified: 2008-01-09
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
Question by:mykapa
    LVL 48

    Accepted Solution


    Author Comment

    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 :(

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 71
    scoreUp challenge 14 40
    for loop with Set 4 37
    How Complex Is This Java Course ? 9 51
    This article will show, step by step, how to integrate R code into a R Sweave document
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now