Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
??? application.screenupdating no longer works! Why???
I am getting a bit frustrated. I found this question in several places, but
no answers. Please help! The command: "application.screenupdating = false" no longer works. I restarted my computer and restarted Excel. I opened a new workbook, and typed in a test macro. sub test() application.screenupdating = false .... No matter what I do, I can no longer get screen updating to stop. I was running a macro that opens a *.wk3 file, copies info into a *.xls file, and continues with the next .wk3 file. When I am done, I have a neat list of information in Excel compiled from 3,500 .wk3 files. To speed things, I used at the beginning of my code: application.screenupdating = false It worked beautifully for a while. However, some .wk3 files contained an error in a specific cell and would stop until I responded to the alert. To avoid the annoying alert, I used this: on error resume next application. displayalerts = false Maybe this caused a problem? Thanks for your help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
??? application.screenupdating no longer works! Why???
All I can suggest is that you debug the line of code that is causing the
value to change. Set up a watch expression on Application.ScreenUpdating and ask it to stop when the value changes. Alok "CraTaw" wrote: I am getting a bit frustrated. I found this question in several places, but no answers. Please help! The command: "application.screenupdating = false" no longer works. I restarted my computer and restarted Excel. I opened a new workbook, and typed in a test macro. sub test() application.screenupdating = false ... No matter what I do, I can no longer get screen updating to stop. I was running a macro that opens a *.wk3 file, copies info into a *.xls file, and continues with the next .wk3 file. When I am done, I have a neat list of information in Excel compiled from 3,500 .wk3 files. To speed things, I used at the beginning of my code: application.screenupdating = false It worked beautifully for a while. However, some .wk3 files contained an error in a specific cell and would stop until I responded to the alert. To avoid the annoying alert, I used this: on error resume next application. displayalerts = false Maybe this caused a problem? Thanks for your help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
??? application.screenupdating no longer works! Why???
I followed your suggestion to set a watch for a change and ran the following
code. Sub test() Application.ScreenUpdating = False Range("a1") = "aaa:" MsgBox (Application.ScreenUpdating) Application.ScreenUpdating = True End Sub The results: The messagebox said "False" as expected. The watch stopped at each screenupdating call, to signal that a change had occurred; again as expected. However, something is badly messed up. I stepped through the test code to see what I could find. After executing "Application.ScreenUpdating = False", I hovered my mouse over "Application.ScreenUpdating" and it said "True". Very strange!?! After it executed the next line [Range("a1") = "aaa:"], it immediately updated the screen. Now that's bad!?! So now I'm wondering what is going on. Any help will be appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
??? application.screenupdating no longer works! Why???
There is a difference between running code in Debug from the VBE and running
normally whilst looking at Excel. AFAIK, VBE can reset the ScreenUpdating to True whilst debugging, otherwise you cannot see what happened. Run the code normally and see the difference. You would of course need some code that would actually be noticably different with ScreenUpdating=True or False. NickHK "CraTaw" wrote in message ... I followed your suggestion to set a watch for a change and ran the following code. Sub test() Application.ScreenUpdating = False Range("a1") = "aaa:" MsgBox (Application.ScreenUpdating) Application.ScreenUpdating = True End Sub The results: The messagebox said "False" as expected. The watch stopped at each screenupdating call, to signal that a change had occurred; again as expected. However, something is badly messed up. I stepped through the test code to see what I could find. After executing "Application.ScreenUpdating = False", I hovered my mouse over "Application.ScreenUpdating" and it said "True". Very strange!?! After it executed the next line [Range("a1") = "aaa:"], it immediately updated the screen. Now that's bad!?! So now I'm wondering what is going on. Any help will be appreciated. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
??? application.screenupdating no longer works! Why???
Hi,
I agree with you that you get a wrong value in the tool tip when you hover over the Application.ScreenUpdating in your code. However, you do get the correct indications when you display the value of Application.ScreenUpdating in the Watch window. Your main objective is to identify the reason why Application.ScreenUpdating is being turned back to True at some stage of your processing. I would still suggest that you set a watch (Break When Value Changes) and examine your code. Obviously to begin with the Application.ScreenUpdating will be true. The code should stop once when you turn it off before your main processing begins. At that time you should let the code proceed by pressing F5. You just needs to watch the line of code at which the value changes again from False to True. Alok "CraTaw" wrote: I followed your suggestion to set a watch for a change and ran the following code. Sub test() Application.ScreenUpdating = False Range("a1") = "aaa:" MsgBox (Application.ScreenUpdating) Application.ScreenUpdating = True End Sub The results: The messagebox said "False" as expected. The watch stopped at each screenupdating call, to signal that a change had occurred; again as expected. However, something is badly messed up. I stepped through the test code to see what I could find. After executing "Application.ScreenUpdating = False", I hovered my mouse over "Application.ScreenUpdating" and it said "True". Very strange!?! After it executed the next line [Range("a1") = "aaa:"], it immediately updated the screen. Now that's bad!?! So now I'm wondering what is going on. Any help will be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
application screenupdating issue | Excel Programming | |||
PLEASE PLEASE HELP Application.Screenupdating | Excel Programming | |||
Application.ScreenUpdating MsgBox | Excel Programming | |||
Application.ScreenUpdating problem | Excel Programming | |||
Question on application.screenupdating | Excel Programming |