|
-
Mar 31st, 2010, 12:37 PM
#1
Thread Starter
Member
[RESOLVED] Subclassing in VBA
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
-
Mar 31st, 2010, 12:44 PM
#2
Re: Subclassing in VBA
Did you try just drawing one inside of a panel?
-
Mar 31st, 2010, 01:04 PM
#3
Thread Starter
Member
Re: Subclassing in VBA
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
-
Mar 31st, 2010, 01:16 PM
#4
Re: Subclassing in VBA
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.
-
Mar 31st, 2010, 01:35 PM
#5
Re: Subclassing in VBA
because subclassing is prone to crashing when you enter debugging mode.
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.
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...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Mar 31st, 2010, 02:10 PM
#6
Thread Starter
Member
Re: Subclassing in VBA
I would like to thank you both for responding to my question and for your advice.
Garrett
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
|