[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

excel 2007 how do i create a button in "add-ons" menu?

Posted on 2011-04-26
10
Medium Priority
?
456 Views
Last Modified: 2012-05-11
excel 2007 how do i create a button in "add-ons" menu?
for instance a button when pressing
 will show a message "hello word"

thanks in advance
gvilbis
0
Comment
Question by:gvilbis
  • 5
  • 4
10 Comments
 
LVL 10

Accepted Solution

by:
cjrmail2k earned 336 total points
ID: 35465926
if you create a macro that will pop that up, then right click on the menu bar and select customise, go to commands and select maccro.
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 1664 total points
ID: 35465963
You'll need to either edit the XMl of the workbook or add the button in code too. For example:
Sub AddButton()
   With Application.CommandBars(1).Controls.Add()
      .Style = msoButtonCaption
      .Caption = "my button"
      .OnAction = "mymacro"
   End With
End Sub
Sub MyMacro()
   MsgBox "Hello world"
End Sub

Open in new window


For customising the Ribbon properly, see Ron's pages here: http://www.rondebruin.nl/ribbon.htm

HTH
Rory
0
 

Author Comment

by:gvilbis
ID: 35466038
how do i add button to excel file?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gvilbis
ID: 35466054
what i have to do inorder to see the button in the menu?
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 1664 total points
ID: 35466057
From the Developer tab - (under Excel Options - Popular section if it's not already visible.)
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 1664 total points
ID: 35466060
If you run the first code, the button should appear in the Addins tab.
0
 

Author Comment

by:gvilbis
ID: 35466960
When i am pressing on the button i am receiveing an error message(see print screen)

please advice

Thanks
my-button.jpg
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 1664 total points
ID: 35467003
Either macros are disabled or you did not store the mymacro macro in the workbook, or did not store it in a normal module. (or you named the module mymacro as well)
0
 

Author Comment

by:gvilbis
ID: 35467203
where do i see if macro is disabled?
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 1664 total points
ID: 35467231
Excel Options - Trust Center and check the Macro Settings there.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question