Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel Workbook Open event from within an addin?

I am trying to trigger a macro to run when an Excel document is opened.

The problem I am running into is that all of my code resides within an Excel add-in. The Workbook_Open event doesn't work because I can't put the code in individual documents, I need it to reside in the add-in and run whenever any document is opened.

Is there a way to modify the Workbook_Open event or is there another way to trigger a macro when a different document is opened?

like image 973
Austin Avatar asked Dec 07 '11 17:12

Austin


People also ask

How do I turn off workbook open event?

Start Excel Application > Go to File > Recent > Doing this will prevent the Workbook_Open event from firing and the Auto_Open macro from running.


1 Answers

You need to use an Application event. There is a good writeup on how to do this at Chip Pearson's site here.

like image 102
Charles Williams Avatar answered Oct 07 '22 02:10

Charles Williams