How can I run a UserForm from XLAM addin (Excel 2013)?

simurq

Board Regular
Joined
Nov 11, 2011
Messages
73
I searched for an answer to no avail yet...

The Custom UI xml file contains the following (XML brackets replaced with regular ones):
<group id="gSettings">(group id="gSettings")
(button id="bSettings" label="Settings" size="large" onAction="ShowSettingsForm" image="settings-btn" /)
(/group)

This is the macro itself inside a separate module:
Sub ShowSettingsForm_Click()
frmSettings.Show
End Sub
I tried to name the macro both with and without the "_Click" part. But it doesn't work either.

Error message that pops up when pressing on the addin button:
"Cannot run the macro 'ShowSettingsForm'. The macro may not be available in this workbook or all macros may be disabled"</group>

Any help is appreciated!
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
The macro should start with:

Code:
Sub ShowSettingsForm(ByVal control As IRibbonControl)

and should be in a normal module in the add-in.
 
Upvote 0

Forum statistics

Threads
1,223,961
Messages
6,175,652
Members
452,664
Latest member
alpserbetli

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