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?

1 Answer 1

1

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/

Sign up to request clarification or add additional context in comments.

2 Comments

The link is helpful but it does not answer my question. I have a VB.NET application that opens an Excel Workbook. I want an event in the workbook to trigger some code in the same application that opened the workbook in the first place.
Should work on the same principle I think. Just make sure that the VB.Net Application that opens Excel have a COM compatible interface and register that interface properly and then the VBA should be able to connect back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.