Forum Discussion
When creating a button in the ribbon it's calling macro location. Best way to remove and manage?
aabarreda to confirm, your add-in is calling routines in other workbooks? I would handle it all in VBA as opposed to ribbon callbacks. Set your onAction to call a routine located in the add-in itself. Then, in your VBA callback, set what you want to do there.
For multiple ribbons I would recommend using a shared namespace, but it's a little unclear as to the entire hierarchy of your ribbons and how they relate and are consumed by your users. Assuming for the moment that all of your add-ins, used by multiple users, are of the same framework/usage, a namespace would collect them all under a single banner. For example, you could have multiple add-ins utilizing the same ribbon tab, with groups appearing only for those installed add-ins.
Here is an example of a ribbon xml utilizing a shared namespace. When creating add-in ribbons, you can use it as a template, keeping the 'nmNameHere' (namespace name) the same across all add-in custom ribbons. This will ensure they utilize the same ribbon tab, although you can structure it any way you want.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" xmlns:nmNameHere="A name for your namespace">
<ribbon>
<tab idQ="nmNameHere:YourTabNameHere" label="Label Text Here">
<group idQ="nmNameHere:grpExport" label="Your Label" autoScale="false" imageMso="ImageMSOHere" insertBeforeQ="nmNameHere:GroupNameHere" >
<!-- Your button commands go here -->
</group>
</tab>
</ribbon>
</customUI>
- aabarredaApr 29, 2020Copper Contributor
Zack Barresse Appreciate the reply.
Now that I've written out I think the issue is I'm creating the ribbon before I've created the excel add in file and installed it. So at that point in time the vba only exists in my local workbook.
This would solve my problems will look into this. "For example, you could have multiple add-ins utilizing the same ribbon tab, with groups appearing only for those installed add-ins."
Thanks so much.
-Alberto