Solved

Can't add protected add-in macro to ribbon

Posted on 2011-09-19
4
415 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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

695 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