Calling VB.NET code from Excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prasoon99
    New Member
    • Apr 2010
    • 1

    Calling VB.NET code from Excel

    I open an Excel workbook from VB.Net and then want an event in the workbook (such as pressing a button) to activate code in VB.Net. How do I accomplish this type of callback?
  • robjens
    New Member
    • Apr 2010
    • 37

    #2
    Im very new at this too but from what I learn, i think you need to compile your .NET code to a library and register for COM interop (project properties -> compile).

    Then you register that .dll within VBA through "references ". Sounds simple, isn't really. I tried about a 1 or 2 hours with tons of Google searches but failed many times. Then I switched to .NET all together. I still use Office applications though but through my Windows Forms .NET application instead.

    p.s. try looking at designing Office add-ins in Visual Studio, these should be able to do what you are looking for

    Comment

    Working...