Workbook_Open handler not invoked when Workbook is opened

I have an xlsm workbook which currently uses Auto_Open to perform some initialization processing which includes display of a UserForm and associated handlers for the buttons on the UserForm. I'm trying to convert from using Auto_Open (which I'm told is "obsolete") to using a Workbook_Open event handler within the Thisworkbook module within the list of Microsoft Excel Objects. I cut/pasted the logic from the Auto_Open routine within my code module into the Private Sub Workbook_Open() within the Excel Objects module, then deleted the shell of the Auto_Open routine.  But now when I open the workbook there is no evidence that any code within Workbook_Open is ever executed.  Is there some setting I'm missing somewhere to enable event handling?

cw

August 27th, 2015 10:57am

Is there some setting I'm missing somewhere to enable event handling?


No, but maybe the code is not in the correct place or the sub is not in the correct format...

Have a look here:

http://www.wiseowl.co.uk/blog/s194/event-handling-vba.htm

Andreas.

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 2:04pm

I used exactly the technique the wiseowl blog suggests to create a Workbook_Open() handler within Thisworkbook.  Still, no evidence the code is executed when I open the workbook.  Especially frustrating because I can create a functional handler in a brand new workbook.  I just can't get the handler to work for this pre-existing workbook.  Sigh.
August 27th, 2015 4:01pm

Hi,

This is the forum to discuss questions and feedback for Microsoft Excel, I'll move your question to the MSDN forum for Excel

http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

George Zhao
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 1:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics