View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tushar Mehta Tushar Mehta is offline
external usenet poster
 
Posts: 1,071
Default XL97 Private Sub Workbook_Open() Not Working

In article ,
says...
Tushar Mehta wrote in
om:

Did you at some point execute a 'Application.EnableEvents=False'
statement and not reverse the effect? EnableEvents doesn't affect the
Auto_Open routine.



Yes I did but then took it out.

Seems strange. I am redoing this from scratch and importing the sheets and
routines one by one to try and pin point where this is occuring.

No, nothing strange. EnableEvents is a persistent setting that XL
remembers for the duration that it is running. Too many use (or
recommend) EnableEvents=False without realizing how long lasting its
effect can be. IMO, the only safe way to use it is within the
equivalent of VB.Net's Try...Catch...Finally structure. In VBA, the
closest would be:

'...
On Error Goto CleanUp
Application.EnableEvents=False
'...
CleanUp:
Application.EnableEvents=True
End Sub
--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions