Workbook_Open Sub not called when spreadsheet is opened

D

dhputnam

I have a number of spreadsheets that have code in the Workbook_Open Sub, but
the code never gets executed when the spreadsheet is opened. Even if I set a
breakpoint in this code, it never hits the breakpoint, which leads me to
believe that the Workbook_Open Sub is not being invoked when the spreadsheet
is opened. I have the same problem with the Workbook_Activate.

The code in the Workbook_Open calls a macro. I can invoke the macro with
the shortcut key (Ctrl+Shift+Q), and it works fine. Because of another
problem I had using shortcut keys, I removed the shortcut from the macro, but
the Workbook_Open still did not get called.

The spreadsheets were created in Excel 2000 and then were modified and saved
in Excel 2003. I never had the problem with Excel 2000. I have tried
copying all of the worksheets from one of my spreadsheets into a new Excel
2003 spreadsheet, and the problem does not occur, but all of the formulas,
pivot tables, etc. point to the original file, so it is more trouble than it
is worth to try to fix all of these references.

Does anyone have any suggestions about how to fix my original spreadsheets?

Thanks for your help.
 
R

RyanH

Maybe your events have been disabled somehow.

Type this in the Immediate Window. Hit Ctrl + G to activate window.

Application.EnableEvents = True

This will ensure that all events in the application are enabled, thus should
run your Workbook_Open Event.

Hope this helps! If so, let me know and please click "YES" below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top