Goal: Add a progressbar to a panel within a statusbar
I have seen that subclassing as a solution to this online, but since I am stuck with using solely VBA, is there a way to subclass with it?
Thanks
Garrett:wave:
Printable View
Goal: Add a progressbar to a panel within a statusbar
I have seen that subclassing as a solution to this online, but since I am stuck with using solely VBA, is there a way to subclass with it?
Thanks
Garrett:wave:
Did you try just drawing one inside of a panel?
That did work, but can subclassing be done in general with VBA?
Thanks by the way, I am just trying to learn as much as possible. I just don't want to spend time trying to find a solution if there isn't one to be found.
Thanks again,
Garrett
I would strongly recommend against subclassing in VBA, because subclassing is prone to crashing when you enter debugging mode.
Due to the fact that VBA is hosted within another app, and that it regularly enters debugging mode automatically, crashing is very likely - and it is likely to crash the app as well as VBA.
There are ways to significantly reduce the risks of subclassing (such as the "Paul Caton" method), but they don't eliminate it completely.
I absolutely agree with Si, however, it can be avoided. It takes some practice to figure out how to jump out of a program in the middle without crashing.Quote:
because subclassing is prone to crashing when you enter debugging mode.
Any time you subclass a program, you can easily crash the entire VBA IDE, losing any changes you have made. For example if you click the IDE's Halt button, the IDE does not clean up the subclassed WindowProc properly and crashes. The basic problem is the object doesn't have a chance to process the teardown messages normally because the original WindowProc doesn't run.
To avoid serious inconvenience, save your program every time you run it so you don't lose a lot of work if you accidentally crash the IDE in this way.
Don't use the halt button. Instead close the form normally. If you close it by unloading it or by clicking on the little X button in the upper right corner, VBA cleans up the mess and the IDE will not die...
Hope this helps...
ps: If you can avoid subclassing, avoid it...
I would like to thank you both for responding to my question and for your advice.
Garrett