Creating a Menu

StevenD

Active Member
Joined
Nov 17, 2004
Messages
262
Hi,

I would like to be able to create a menu that will appear everytime i open a new workbook (open excel).

How would I do this?

Thanks

Steve
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
Have you looked at the help? What would you put on the menu? Do you have experience of VBA?
 
Upvote 0

StevenD

Active Member
Joined
Nov 17, 2004
Messages
262
Hi Glenn,

Yes i do have experience of VBA.

I use the following code normally, but don't think it would work without this book open.



Code:
Public Sub SetupMenu()
Dim newMenu, newMenuItem
newMenu.Caption = "&Projects"
Set newMenuItem = newMenu.Controls.Add(Type:=msoControlButton)
newMenuItem.Caption = "&Open Project Log"
newMenuItem.OnAction = "Log"
With CommandBars("worksheet menu bar")
Set newMenu = .Controls.Add(Type:=msoControlPopup, before:=.Controls("window").Index, temporary:=True)
End With
End Sub

Do i need to write this code and the sub it calls (Log), in the default workbook that the menu is there ecerytime you open excel?

thanks

Steve
 
Upvote 0

Ste_Moore01

Active Member
Joined
Jul 13, 2005
Messages
467
ADVERTISEMENT
I'm not sure about the VBA code, but when I made my own Menu I used the menu maker at this link. http://www.j-walk.com/ss/excel/tips/tip53.htm

When I had modified the menu to my own things, I changed the code so that the message about creating a new menu didn't come up everytime you opened the menu maker file.

Once I'd done that, I saved the menu maker file in the XLStart folder in my Office files in Program Files so that it opens everytime I open Excel and automatically makes my menu.

The only problem with doing that is, you see the menu maker everytime excel opens so I clicked Window and Hide and saved it when I closed. Now the menu maker doesn't appear when I load Excel but it loads my menu.

I know it's not the most professional way to make a menu but it works.

I'm sorry I can't help you with the code because I'm not too good with VBA code... that's why I come here for help everyday! :oops: :p
 
Upvote 0

StevenD

Active Member
Joined
Nov 17, 2004
Messages
262
Many thanks for your help.

I also found I had to make excel point to the XLstart folder, by going to tools, options, general.
 
Upvote 0

Forum statistics

Threads
1,195,909
Messages
6,012,256
Members
441,687
Latest member
urimagic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top