Turning off screen updating and setting calculation mode to Manual are the only application settings you can use to improve performance; the rest depends on your algorithm.Your description of the problem is a bit vague: How large are your projects and how long does the macro take?Also, make sure you define your variables with appropriate types as relying on the default Variant data type is very slow.which obviously isn't working because the screen updates a whole lot afterwards. I almost wish this were more complicated; the fact that everything looks so simple is making it difficult to think of what could possibly be happening! So this morning application.screen Updating was working as expected. The test code that I wrote is below: Sub test() Debug. One thing that seems to be common among those modules not working, is that they all contain code that changes worksheets. In any case, it's a real mystery why this happens from one day to another! All those Screen Updating = False's you see is called "sheer desperation". I can still enter the workbook and it is screenupdating away even right after the line set it false. Screen Updating = False" in the immediate window it works as expected. Thanks Colin Correct, when you step through in debug mode the screenupdating remains turned on. To test it properly, try this: Put a commandbutton on your sheet and paste in Application. Net) | Coordinates, Vectors and 3D volumes I've experienced this problem, with code that previously worked! Well, the function is quite long, but you're looking at the function's entry point. The immediate window says True, then False, then True again as expected, but the code doesn't seem to have any effect on the application. If all of this happens, then you know it is working correctly. Net 2003 and Office 2010 Code: Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA, VB.Here is a variable to store the handle: Dim lng Handle As Long 'lockwindowupdate returns a zero if it failed, so heres a container for checking 'the return Dim Ret As Long 'we'll use this in the "error trap" Dim bln Tried Already As Boolean 'To find the handle for the Project window we'll use the Find Window function, again part 'of the Win32 API.This function accepts two arguments, the Classname and the caption of the window 'I have Project 2002, the class name of the MS Project window is JWinproj-Whimper Main Class 'I have no idea what it might be for other versions of Project.
Screen Updating = false" because I saw the yellow highlight go over the line in debug mode. Calculation = xl Calculation Automatic Application. Screen Updating from within the code instead of the immediate window, but I'm fairly sure what I'll find. This function gets called by an event handler that catches a Commands Bar button event (? Basically, we create a menu bar and one of the buttons in our custom "File" menu is labeled "Load Portfolio" which calls this function. I have encountered the same symptoms and can't think as to why it's happening. I think that maybe something has broken in my excel because even when I closed out of excel and opened a brand new 2003 workbook with no previous code I was getting the same problem. The interesting thing is that *some* of my modules allow Screen Updating to be set to False, there's only a few that don't.
If your projects are 1,000 tasks and you are making a dozen checks and your code takes more than five minutes, then yes, there is surely room for improvement.
But if it's 20,000 tasks and 50 checks and the macro takes two minutes, stop trying to improve it--that's great performance. Start) in several different comparisons in your code then set the property into a local variable once and then perform your comparisons on the local variable.
However, I *can* change the Screen Updating from the immediate window. Screen Updating = False b Global Change Event = True Application. About to go home for the day, but I plan on trying to print Application. So while Screen Updating always is True in debug mode, this is not the issue for me.
Sub load Portfolio() Dim i Test As Integer, portfolio Version As String Application. :-) Basically, after all those statements (and between each one) Screen Updating remains "True". Screen Updating = False For i = 1 To 10000 Worksheets("Sheet1"). Screenupdating = False worked perfectly in Excel 2007 until last week, when it remained True however many times I tried to set it to False.