View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default Workbook_open event disabled by manual calc command

I can't reproduce your problem. Are you sure that the procedure which
changes the application.calculation value doesn't also change
Application.EnableEvents?
Maybe you can do a project-wide search for occurences of
"Application.EnableEvents"

Is the problem is showing up when you invoke Workbooks.Open() to open
a workbook with a workbook_open event-handler? Maybe before the
offending line you can put the line msgbox Application.EnableEvents
prior to the Open() command to see if the EnableEvents setting has
somehow been changed. If it has been and for some reason you can't
track down just where it was changed a work-around might be to use the
2 lines
ApplicationEnableEvents = True
Workbooks.Open("myfile.xls")

Finally, in the workbook that you are trying to open, have you tried
putting something like msgbox "I'm here!" at the very start of the
workbook_open() sub? It is possible that execution is reaching there
but that your other code has changed something else (other than the
calculation mode) causing the open event to fire but to not work as
usual. If you have some sort of error-trapping it is possible that
this could go unnoticed.

Just a few stabs in the dark. I'm sure you've tried similar things.

-John Coleman


On Mar 12, 9:58 am, Twotone wrote:
I am using Excel 2003 on Windows XP professional.

I have some code that runs every time a workbook is opened. As you would
expect, it makes no difference to the firing of this event whether the
application is set to manual or automatic calculation mode.

However, when I change from automatic to manual calculation using the
following line of code in an unrelated procedure, the Workbook_open event
handler stops working until I close and re-load Excel.

Application.Calculation = xlCalculationManual

Any ideas why this is and what to do about it?

TIA

Anthony