Solved

Can't add protected add-in macro to ribbon

Posted on 2011-09-19
4
406 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
  • 2
4 Comments
 
LVL 5

Expert Comment

by:slycoder
Comment Utility
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 41

Expert Comment

by:dlmille
Comment Utility
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 41

Accepted Solution

by:
dlmille earned 500 total points
Comment Utility
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
Comment Utility
Sorry to neglect my question!

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now