Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can't add protected add-in macro to ribbon

Posted on 2011-09-19
4
Medium Priority
?
418 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

604 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