PDA

View Full Version : Solved: Custom Menu and Toobar Items for a single file.



U_Shrestha
03-18-2008, 09:22 AM
Hello all,

I need help with following things:

1) In the menu bar, I need to display only 'File', and 'Help' Menu. Under 'File', I want to display only Open, Close, Save, Print, Print Preview, Exit. I want all other menu items hidden.

2) In the Toolbar, I want to display only "print preview", and 'print' only.

3) Most importantly, I want this feature only in a particular file, so that a user will see only these items in their Menubar and Toolbar but they would see their own Menubar and Toolbar in their other Excel files. I do not want this feature to affect any of their Excel application.

4) I want to create a keyboard Shortcut (Ctrl+M) or a commandbutton that will enable a default Menubars or the Toolbars in the same file by prompting for a correct password.

Can someone help me with this, or direct me where I can find this feature. Thanks.

Simon Lloyd
03-18-2008, 10:11 AM
Maybe this kb entry will point you in the right direction! kb entry by Killian (http://www.vbaexpress.com/kb/getarticle.php?kb_id=808)

U_Shrestha
03-18-2008, 11:35 AM
Hello Simon,

I noticed that the link shows how to Create a custom "Worksheet Find" toolbar. I am not able to modify the codes to suit it into my workbook to modify Menu bars and Toolbars since I can't write VB for this. Thanks.

lucas
03-18-2008, 03:49 PM
Maybe this one will give you some insight.
http://vbaexpress.com/kb/getarticle.php?kb_id=809

Search the forum and the kb. this is not an easy project for an inexperienced user.......it will require some research on your part and then come back here and ask specific questions. You will have to be careful or you will disable all of your menu items and be back here asking us how to restore them.

If you are interested in a turnkey project......for fair money select consulting from the site links at the top of the page.

Simon Lloyd
03-19-2008, 12:25 AM
My thoughts too Lucas, it's just i was a bit grumpy yesterday so i ended up giving "find it yourself" answers!

Bob Phillips
03-19-2008, 02:20 AM
You could use code like this on the menus (untested)



mpControls = Array("&File","&Help")
For Each ctl In Application.Commandbars(1).Controls
ctl.Visble = Not Iserror(Application.Match, mpControls,0)
Next ctl


and use a more full array to reset them.

U_Shrestha
03-19-2008, 05:58 AM
Thanks guys, I think that was too much too ask :)