|
-
Jul 13th, 2011, 01:13 PM
#1
Thread Starter
Member
[Excel VBA] Status Bar Updating
I'm looking for ways to speed up my program, and one I found was to set
Code:
Application.DisplayStatusBar = False
which stops displaying the status bar. But, though it's not displayed, do you know if it still updates? I know there is another property
Code:
Application.StatusBar
Setting that to False means Excel has control and updates it like normal, setting it to any other string displays that string, and Excel no longer has control.
So, again, my question is, if I hide the status bar, is it still updating? It seems the second option might be better for speeding up code, i.e., Application.StatusBar = "Not updating" and then back to normal after the program is over.
-
Jul 13th, 2011, 03:31 PM
#2
Hyperactive Member
Re: [Excel VBA] Status Bar Updating
I'm looking for ways to speed up my program
It really depends on what you are doing. If you are doing a bunch of calculations, or altering a bunch of calculations, you may just want to turn the autocalc function off at the beginning of your code, and at the end of your code force a calculation and turn the autocalculation back on.
Code:
Application.Calculation = xlCalculationManual 'or xlCalculationAuto
-
Jul 13th, 2011, 03:51 PM
#3
Thread Starter
Member
Re: [Excel VBA] Status Bar Updating
My question is specifically about the status bar. I know about turning calculation off and it doesn't help in this program because it needs to do calculations often. In fact, trying manual calculation slowed down the program noticeably, took around 120% of previous time.
-
Jul 13th, 2011, 04:08 PM
#4
Hyperactive Member
Re: [Excel VBA] Status Bar Updating
The statusbar is just an indication, you can turn it off and it will not affect the functionality.
Application.DisplayStatusBar 'turns the status bar on or off
Application.StatusBar 'allows you to do things with the status bar, such as display a msg
-
Jul 14th, 2011, 03:36 PM
#5
Thread Starter
Member
Re: [Excel VBA] Status Bar Updating
I wish someone would answer my question. So far, no one has.
By the way, I changed my program to use Application.StatusBar = "See progress bar above" instead of Application.DisplayStatusBar = False, and it seems to me that it did improve the speed of my program by a few seconds (based on use of Timer). NOT DISPLAYING the status bar, and STOPPING it from updating are two different things, and my question is whether or not App.DisStatusBar = False does both, or just one. The heart of the question, which of the two methods I just mentioned is going to save more time?
-
Jul 14th, 2011, 03:45 PM
#6
Hyperactive Member
Re: [Excel VBA] Status Bar Updating
So, again, my question is, if I hide the status bar, is it still updating?
I just told you it doesn't affect the functionality of the program, all it does is hide the statusbar, what more do you want me to say... If you are really concerned with it then try it.
Last edited by nO_OnE; Jul 14th, 2011 at 07:42 PM.
-
Jul 14th, 2011, 11:05 PM
#7
Thread Starter
Member
Re: [Excel VBA] Status Bar Updating
 Originally Posted by nO_OnE
I just told you it doesn't affect the functionality of the program, all it does is hide the statusbar, what more do you want me to say... If you are really concerned with it then try it.
First off, I was making a joke. "no one" has answered my question. Secondly, just because you tell me something doesn't mean anything. Can you tell me how you know it? How do you know it doesn't affect the functionality? I'm saying maybe it does. And, your words are not precise enough, or you're not answering my question. I want to know exactly what is going on. You said DisplayStatusBar turns the status bar on or off. What it does obviously is it shows it or hides it. That's not the same as turning it on or off. I can turn my TV on and then put a sheet over it. It's still going to take the same amount of power as it did before, and it's still displaying a picture, even though I can't see it. Perhaps the same thing goes on with the status bar. This is my question. I'm not convinced you know the answer to my question. I'm not trying to be a jerk at all. I'm just saying, if you know the answer, explain to me how you know it to give me some evidence. If you don't know the answer, don't answer.
Yes, I know I can try these things out for myself. I try out many things for myself and learn many things on my own. And, I have tried this out already, as you can see by reading my last post. But, not every question can be learned by trying it out. It's going to be hard to design a program that has a significant amount of status bar updates relative to the program as a whole. And, my program speeds have many variables, other than just the programming itself. Over the last week, I have run the same program 100 times. I am changing the code sometimes. Sometimes, I'm not. The speed of the program is fluctuating between 3 minutes and 3:15 or so (even if I run the exact same code twice). But, it seemed to speed up when I removed the DisplayStatusBar = False and replaced it with StatusBar = "whatever".
-
Jul 15th, 2011, 11:24 AM
#8
Hyperactive Member
Re: [Excel VBA] Status Bar Updating
sorry, didn't realize you were joking, yesterday was a bad day. Anyways 'application.displaystatusbar = false' is just like setting the visible property of a control to hidden. It is still loaded, your code still interacts with it, it is just not visible to the user.
It is kind of hard to prove, because you can use 'application.statusbar' to return the value, but if Excel has control over it then it just returns "False". If you take control over it and assign it various values through your code you can use 'application.statsubar' to return the values that you have assigned to it to prove that it is still updating, but that only proves that it updates when you change it in your code...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|