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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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,214,830
Messages
6,121,839
Members
449,051
Latest member
excelquestion515

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