Results 1 to 4 of 4

Thread: Adding a button to a custom toolbar AT RUNTIME

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    1

    Post

    (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.

  2. #2
    Lively Member *Super Sniper*'s Avatar
    Join Date
    Jan 2000
    Location
    Portland, OR
    Posts
    81

    Post

    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

  3. #3
    Lively Member *Super Sniper*'s Avatar
    Join Date
    Jan 2000
    Location
    Portland, OR
    Posts
    81

    Post

    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

  4. #4
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width