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?
Make the .Net assembly act as a COM object which is quite easy to use from VBA.
See this page for a comprehensive example:
http://richnewman.wordpress.com/2007/04/15/a-beginner%E2%80%99s-guide-to-calling-a-net-library-from-excel/
精彩评论