-
(This is for VBA with Excel)
Hey guys, here's something I thought was real easy... How do I add a button to a toolbar I've created at runtime, and how do I assign it a function, or procedure, or sub or whatever... Basically what I want to do is that whenever someone opens my workbook (thisworkbook.open) I want my toolbar to be generated... It shouldn't be so hard, only I can't find any code for this ANYWHERE!
------------------
Ben. The Man.
-
:) I have an idea: use a picture bar and make a copy of a button during runtime and set it to a speicle index lets say 10 to 19. Then when someone clicks on the button check the index and if it is 10 to 19 you use something like this:
MsgBox "You pressed the new button!",,"NEW"
I hope this helps. :)
------------------
www.kaynor.net
-
:) I have an idea: use a picture bar and make a copy of a button during runtime and set it to a speicle index lets say 10 to 19. Then when someone clicks on the button check the index and if it is 10 to 19 you use something like this:
MsgBox "You pressed the new button!",,"NEW"
I hope this helps. :)
------------------
www.kaynor.net
-
are you using the commandbars.add and commandbars("yourcustombar").controls.add methods, if you don't, dig in the help file for this, if you do, consider this written in error cause you already know what i suggest here