I have a problem with a very short, simple piece of code which runs perfectly in certain parts of the application, but not in others.
The code in question is the command to turn on/off screen updating:
Application.ScreenUpdating = True
or
Application.ScreenUpdating = False
This method works fine in most parts of my code.
Where it fails is when it's part of a routine attached to the activation scetion of a form, and is called a SECOND time from the main macro. The FIRST call is made without error.
The error message I get is: Method 'ScreenUpdating' of object '_Application' failed
The form itself is running in Non Modal state
Does anyone have a clue how I can correct this error?
It didn't manifest itself at all in previous version of Excel.
Many thanks,
Jonesey.
Edit toadd:
Stangely, when editing withing the userform, VB's predictive text actually suggests the option "ScreenUpdating" as soon as I type in application.sc - selecting the option then causes the editor to suggest True or False as alternatives.
VB seems to instinctively KNOW that what I'm typing is correct, it also passes the "Compile VBA project" test, but still throws it up as an error when run
Weird eh?
Edited by Jonesey, 17 November 2009 - 08:15 AM.