Consulting

Results 1 to 20 of 20

Thread: Menu Editor

  1. #1

    Menu Editor

    How can I bring a menu editor in VBA to creat toolbar as a form heading?I have a form for inputing data and I want to have File menu: new/save/Exit menus at the top of my form.
    In VB I right click on the form and there is menu editor.

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi Mary.....why do you keep posting your questions in the announcments forum?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Hi Mary,

    By posting in the Announcments forum, most of us will have no idea what program you are using. I'm just going to hazard a guess on this that because you are using a Form, that it is a Word question. I'm moving your question to our Word forum so that someone can help you out.

    If that is incorrect, please let us know. In future, we'd also appreciate it if you could post your questions in the appropriate forum.

    Thanks,
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    VBA doesn't work like VB, there is no menu editor. If you want one, you will have to build your form in VB, and then call from VBA.

  5. #5
    Dear all,
    sorry if I posted in a wrong place. My posts are related to VBA.

  6. #6
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    What program, Maryam? Word, Excel, Acces, Powerpoint, something else? We have forums devoted to each of them.

    We could use a little more info on your issue before we can start to help you.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  7. #7
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    In any case, xld is correct, there IS no menu editor in VBA.

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Actually, Ivan Moala has an API hack to do it http://www.xcelfiles.com/API_Userform_MenuMaker.html but I must admit it is too cumbersome and not stable enough for my liking. Using a VB menu is simpler if I must have menus.

  9. #9
    Dear Ken Puls,
    It is VBA in Excel.

  10. #10
    Dear xld,
    That procedure is too complicated. So in VBA in Excel we cannot put menu bar at the top of the userform as easily as VB? In VB6 I just used Menu Editer to creat menus and submenus.

  11. #11
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I agree the procedure is complex, and it isn't robust enough in my experience.

    So, in VBA you either use Ivan's API solution, you use a VB6 dll encapsulated menu, or you don't do it.

  12. #12
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Here's a fudged emulator. Not saying it is good, but it is an option

  13. #13
    Dear Xld,
    Thank you, I will try it.



    Regards,
    Maryam

  14. #14
    Dear xld,
    This is perfect . Thank you very much.

  15. #15
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    xld, thanks, that is a nice addition to design options. I changed the commandbuttons to Labels and used Label_Click. I placed the labels right smack up along the top. Having text along the top makes it look more like a menu bar than using commandbuttons.

    Pretty cool. Thanks. It of course does not respond as fast as REAL menu items, but it is fairly quick and does open up possibilities for redirecting code flow. And possibilities for greatly increasing the number of procedures cleanly available to the user from one userform.

    I am a Word guy, rather than Excel, so I made them Word stuff. I also made the Label text dynamic as well. So under Tools, there is a Bookmarks item. Clicking the Bookmarks item changes the label text from:

    File Edit Tools

    to:

    Add Delete Range Go To Export

    With the "Go To" and "Export" labels (previously Visible = False) now set to Visible = True. Controls such as comboboxes etc. become visible depending on which array of labels is visible. And procedures are set up as popups depending on what array of labels are visible.

    Like I said, pretty cool, and definitely gives more design options to userforms.

    Good stuff.

  16. #16
    fuemi,
    Dont you post your file?

  17. #17
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I agree, I would like to see it also, especially if it is Word

  18. #18
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Sorry. Actually...no...I did not as it was just a modification to xld's stuff.

    Give me a little bit. I am just back from three weeks away and I am kind of swamped.

  19. #19
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Um, and...I didn't know I am supposed to post up everything I do for everyone.

  20. #20
    I taught you like to share becasue you explained it. If you dont like then you don't.

Posting Permissions

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