Cannot run macro using customUI Ribbon buttons

MarshmallowMatie

New Member
Joined
Jun 29, 2023
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
I have a workbook add-in saved as 'Generate Report.xlam' that I want to automatically generate reports. I have all of the code for that in the UserForm objects. I have managed to get this setup working with a customUI RIbbon and buttons that call subs in the ThisWorkbook object which open the UserForms but for some reason after changing something that I do not quite remember it gives me this error:
1688074185035.png


My Add-In Project contains:
1688074007311.png

In the ThisWorkbook code I have:
1688074065162.png

My XML for the customUI is:
1688074327599.png


I used Office RibbonX Editor to inject the XML into the Add-in. I have enabled all macros in the settings and set the current add-in's location to a trusted location in the Trust Center.

If anyone could help resolve my issue of my UserForms not opening that would be much appreciated. (On an unrelated note just to make it look cleaner is there anyway to remove the sheet objects to the add-in)
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
It looks like you've set it up correctly.

Your XML code looks fine. You've qualified the onAction reference to your macro with ThisWorkbook. So that's good.

And your VBA callbacks look fine as well.

So if you've enabled macros, it should work.

By the way, in future, instead of posting code as images, please post them between code tags. This way we'll be able to easily copy and paste the code for testing purpose. You can find the button for code tags just above the text area when posting.
 
Upvote 1
Thanks for looking into this Domenic and for the advice for future posts.

I've realized that the file must have not been compiling because I added an assignment of a variable outside of a sub 🫣

It's always the stupid mistakes that get you.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,106
Messages
6,123,124
Members
449,097
Latest member
mlckr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top