Macro Fault on Custom Ribbon

K

Karen

Hi,

I'm trying to create my first custom ribbon, using example code. I saved a
workbook as testingtoolbar.xlsm as well as testingtoolbar.xlam.

The ribbons are visible as well as the solitary test button but when the
button is activated I get the following error message:

"Cannot run the macro 'myButton_ClickHandler'. The macro may not be
available in this workbook or all macros may be disabled."

The folder is a trusted location, it is the local user XLStart folder.
I have enabled all macros

Any suggestions as to how to enable macros for a custom ribbon are welcome
:)

Karen
 
J

Jim Rech

Make sure the macro is "available". Spelled right, in the same workbook,
etc. If you're sure that you did everything right feel free to send me the
workbook. I've done a thousand ribbons; or it feels that way<g>.

--
Jim
| Hi,
|
| I'm trying to create my first custom ribbon, using example code. I saved
a
| workbook as testingtoolbar.xlsm as well as testingtoolbar.xlam.
|
| The ribbons are visible as well as the solitary test button but when the
| button is activated I get the following error message:
|
| "Cannot run the macro 'myButton_ClickHandler'. The macro may not be
| available in this workbook or all macros may be disabled."
|
| The folder is a trusted location, it is the local user XLStart folder.
| I have enabled all macros
|
| Any suggestions as to how to enable macros for a custom ribbon are welcome
| :)
|
| Karen
|
 
K

Karen

Thanks a lot, I had

Sub myButton_ClickHandler(control As IRibbonControl)
MsgBox "MyButton was clicked!"
End Sub

in ThisWorkbook and it did not work

I moved it to to the Modules folder in that workbook to Module 1(not
creative name but I'm just playing now) and it worked :)


Karen Hagerman

Hi Karen

Look the sub like this in the VBA module

'Callback for customButton1 onAction
Sub Macro1(control as IRibbonControl)

End Sub



More info here
http://www.rondebruin.nl/ribbon.htm
 
K

Karen

Thank you, I very well might take you up on it. I am trying to extend the
'learning' to a real custom tab so......................who knows when I'll
be totally frustrated :)

Karen

Make sure the macro is "available". Spelled right, in the same workbook,
etc. If you're sure that you did everything right feel free to send me the
workbook. I've done a thousand ribbons; or it feels that way<g>.

--
Jim
| Hi,
|
| I'm trying to create my first custom ribbon, using example code. I saved
a
| workbook as testingtoolbar.xlsm as well as testingtoolbar.xlam.
|
| The ribbons are visible as well as the solitary test button but when the
| button is activated I get the following error message:
|
| "Cannot run the macro 'myButton_ClickHandler'. The macro may not be
| available in this workbook or all macros may be disabled."
|
| The folder is a trusted location, it is the local user XLStart folder.
| I have enabled all macros
|
| Any suggestions as to how to enable macros for a custom ribbon are welcome
| :)
|
| Karen
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top