By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,693 Members | 1,754 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,693 IT Pros & Developers. It's quick & easy.

Calling VB.NET code from Excel

P: 1
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?
Apr 19 '10 #1
Share this Question
Share on Google+
1 Reply


P: 37
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
Apr 23 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.