PDA

View Full Version : Menu Editor



maryam
01-16-2007, 06:50 AM
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.

lucas
01-16-2007, 10:26 AM
Hi Mary.....why do you keep posting your questions in the announcments forum?

Ken Puls
01-16-2007, 05:00 PM
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,

Bob Phillips
01-16-2007, 05:33 PM
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.

maryam
01-16-2007, 08:16 PM
Dear all,
sorry if I posted in a wrong place. My posts are related to VBA.

Ken Puls
01-16-2007, 09:03 PM
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. :)

fumei
01-16-2007, 10:34 PM
In any case, xld is correct, there IS no menu editor in VBA.

Bob Phillips
01-17-2007, 03:03 AM
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.

maryam
01-17-2007, 03:45 AM
Dear Ken Puls,
It is VBA in Excel.

maryam
01-17-2007, 05:23 AM
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.

Bob Phillips
01-18-2007, 05:08 AM
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.

Bob Phillips
01-18-2007, 05:26 AM
Here's a fudged emulator. Not saying it is good, but it is an option

maryam
01-18-2007, 05:28 AM
Dear Xld,
Thank you, I will try it.



Regards,
Maryam

maryam
01-18-2007, 05:47 AM
Dear xld,
This is perfect:clap: . Thank you very much.:)

fumei
02-14-2007, 10:41 PM
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.

maryam
02-14-2007, 11:15 PM
fuemi,
Dont you post your file?

Bob Phillips
02-15-2007, 03:16 AM
I agree, I would like to see it also, especially if it is Word :)

fumei
05-03-2007, 08:13 AM
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.

fumei
05-03-2007, 08:30 AM
Um, and...I didn't know I am supposed to post up everything I do for everyone.

maryam
05-03-2007, 07:31 PM
I taught you like to share becasue you explained it. If you dont like then you don't.