?
Solved

Can't add protected add-in macro to ribbon

Posted on 2011-09-19
4
Medium Priority
?
416 Views
Last Modified: 2012-08-14
Hi everyone.  

I have an add-in that contains a simple macro (public sub) that I would like to run when I click a button in the ribbon in Excel 2007.  I know how to assign macros and run them in the ribbon, but this is different.

The add-in is password protected.  Whenever protection is ON, we can't see the public sub in the list of available macros to assign to a button.  When we turn protection off, the sub shows up fine, and we are able to assign it without problems.

How can I assign a button to a macro subroutine that sits inside a protected add-in?
0
Comment
Question by:jacksonm1234
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:slycoder
ID: 36561956
I haven't used many add-ins (esp. that are protected) -


I would try to turn off protection, assign it as you desire.

save the workbook, turn on protection, save it again and close the workbook.

try to re-open it and test the button.



Thanks
0
 
LVL 42

Expert Comment

by:dlmille
ID: 36563040
How about customizing the addin to provide you with a menu option in the addins ribbon?

Read on, and advise if you need further assistance.

http:/Q_26837274.html

Dave
0
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 total points
ID: 36563080
Here's an add-in template that's more recent than that post, I provided.

Try it out and let me know if you have any questions.

If you like it after you modify it, just save the .xls as an add-in (.xla)

In the MenuBarHandling public module, find the CreateMenu() routine.  That's where all the toolbar stuff happens.  Note the OnAction method being use to call a macro as a result of a button selected, etc.

The AddinHandling public module handles opening/closing the add-in based on different conditions

The MacroModule public module is where you can put all your macros (one place, anyway) that are called as a result of the OnAction method triggered by the menu option selected.

You should have no problems with protected addins, after leveraging the add-in in providing your menu options, as opposed to sticking buttons in Excel on the ribbon.

Cheers,

Dave
Add-in-Template.xls
0
 
LVL 2

Author Closing Comment

by:jacksonm1234
ID: 36589725
Sorry to neglect my question!

This solution worked great.  We implemented it immediately and worked as expected.  THANK YOU!
0

Featured Post

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!

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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 Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

765 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