Consulting

Results 1 to 11 of 11

Thread: MenuBar on a form in VBA

  1. #1

    MenuBar on a form in VBA

    Hello Guys,
    I am working with VBA and in contrast with VB6 there's no Menu Editor in Tools. How do I put a MenuBar on a form in VBA environment?

    Thanks a lot,
    Serge

  2. #2
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    HI Serge...

    You can add the toolbar control to your toolbox by right clicking and adding controls...that would allow you to drag a toolbar onto a form. You can then add buttons and such...

    I think that would work anyway...

    Pete
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  3. #3
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    Check this out for an impressive way to put a menu on a userform:
    http://www.xcelfiles.com/API_Userform_MenuMaker.html
    Only works on Excel 2000 and above.

    Marcster.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Autofreak
    Hello Guys,
    I am working with VBA and in contrast with VB6 there's no Menu Editor in Tools. How do I put a MenuBar on a form in VBA environment?

    Thanks a lot,
    Serge
    Difficult!

    There are API solutions out there, but I have not found a stable free one yet.

    Another solution, and my preferred option, is to to build a VB form, and use this in an Excel solution. However, this is decidedly more complex, and needs a full VB license.

    If you are happy with just buttons, XLGibbs toolbar is an option

  5. #5
    Quote Originally Posted by Marcster
    Check this out for an impressive way to put a menu on a userform:
    http://www.xcelfiles.com/API_Userform_MenuMaker.html
    Only works on Excel 2000 and above.

    Marcster.
    Hi Marcster,

    Yeah! it is impressive. One problem , it can be modalless...and I can use it only when its ShowModal property is set to False. The author is saying that the right version is coming soon. But it's a great solution anyway. It's cool to be able to work with API's . Where do I start to learn that??

    Thanks
    Serge

  6. #6
    I tried to put a toolbar and a few buttons on it but they slipped thru the toolbar and dropped to the form. How do I make them stay on the toolbar??
    Thanks,
    serge

  7. #7
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    How were you adding the buttons? If you were dragging buttons from the control toolbar to the form, that is why..

    I haven't used toolbars on forms except for in VB, so I am just guessing that you have to add them using the commandbar.add(msoControlButton...) type syntax in code...

    Similar to make a custom toolbar on the spreadsheet itself...just a guess though..
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  8. #8
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    Quote Originally Posted by Autofreak
    Hi Marcster,

    Yeah! it is impressive. One problem , it can be modalless...and I can use it only when its ShowModal property is set to False. The author is saying that the right version is coming soon. But it's a great solution anyway. It's cool to be able to work with API's . Where do I start to learn that??

    Thanks
    Serge
    Here's some info to get you started. It's on MSDN:
    http://msdn.microsoft.com/library/de...windowsapi.asp

    HTH,

    Marcster.

  9. #9
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Serge

    To add buttons to the toolbar got to (Custom) on the properties sheet.

  10. #10
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Autofreak
    Yeah! it is impressive.
    It looks good but it ain't exactly stable. I tried it once in a serious app and it hust couldn't be relied on, so I removed it.

  11. #11
    Thanks Guys,
    those are very helpful tips!! I am gonna go with the toolbar. do I grade the ansewres on this forum?

    Serge

Posting Permissions

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