Access Cannot Run the macro or callback function: Access 2013

I have a database here with the following xml loaded into the system table, USysRibbons.  I keep getting an error:

Microsoft Access cannot run the macro or callback function 'MyToogleButtonCallbackAction'

This is a sample db taken from:

http://www.accessribbon.de/en/?Downloads:1

I'm using Access 2013.

Below is the xml entry and macro code

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="MyTab" label="My Tab">
        <group id="MyGroup" label="My Group">

          <labelControl id="myLabel1" label="Sample:" />
          <labelControl id="myLabel2" label="Toogle Buttons" />

          <toggleButton id="MyToogleButton1" size="large" label="Large Toggle Button" imageMso="HappyFace"
            onAction="MyToogleButtonCallbackOnAction"/>
          <toggleButton id="MyToogleButton2" size="normal" label="Small Toggle Button" imageMso="HappyFace"
            onAction="MyToogleButtonCallbackOnAction"/>
          <toggleButton id="MyToogleButton3" size="normal"  imageMso="HappyFace"
            onAction="MyToogleButtonCallbackOnAction"/>
          <toggleButton id="MyToogleButton4" size="normal" label="Small Toggle Button"
            onAction="MyToogleButtonCallbackOnAction"/>

        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Open in new window


macro

Option Compare Database
Option Explicit

Sub CallbackCut(control As IRibbonControl, ByRef bolCancel As Boolean)
    MsgBox "Cut"
    bolCancel = True
End Sub

Sub CallbackCopy(control As IRibbonControl, ByRef bolCancel As Boolean)
    MsgBox "Copy"
    bolCancel = True
End Sub

Public Sub MyToogleButtonCallbackOnAction(control As IRibbonControl)
    MsgBox "test"
End Sub

Open in new window

SampleRibbon1.accdb
sterlingalstonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sterlingalstonAuthor Commented:
Thanks, all!
Jeffrey CoachmanMIS LiasonCommented:
Do the other subs run?
sterlingalstonAuthor Commented:
Unfortunately I don't know.  They definitely run without the iribbon control argument.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Jeffrey CoachmanMIS LiasonCommented:
How are you running that code?
sterlingalstonAuthor Commented:
the target macro is MyToogleButtonCallbackOnAction

i run it by clicking on any of the buttons in the My Tab
Jeffrey CoachmanMIS LiasonCommented:
Oh, OK, sorry I thought you were using VBA,...lets see if an Expert in macros will chime in...
sterlingalstonAuthor Commented:
Um... it is VBA, but it's called from the Ribbon. Like an Excel add-in, except this is through Access system table
Jeffrey CoachmanMIS LiasonCommented:
Then can you post a sample of this database for us to investigate?
sterlingalstonAuthor Commented:
The sample is attached in the post, right?
SampleRibbon1.accdb
Jeffrey CoachmanMIS LiasonCommented:
1. Still not seeing how or when that ribbon code is being executed...?
2. The query needs the table "tblAccessRibbControls"
sterlingalstonAuthor Commented:
Thanks for your help, but there is not ribbon code/ macro and there is no query.  It's a system table called USysRibbons.

This article explains in a few sentences:

http://www.accessribbon.de/en/?Access_-_Ribbons:Load_Ribbons_Into_The_Database:..._Using_The_System_Table_USysRibbons

Right-click the top of the Navigation Bar "All Access Objects" and select Navigation Options, check the Box that says "Show System Objects".

There you'll find the table with all the ribbon names and xml customui code. The ribbon that loads is ID 37
access-ribbon.JPG
sterlingalstonAuthor Commented:
Any updates?

I've managed to get this working in a separate DB, but this now isn't working in the DB I've imported this to.

I have a table called 'RibbonUItbl' and a macro called LoadRibbons that contains the method     Application.LoadCustomUI rs("RibbonName").Value, rs("RibbonXml").Value

Any ideas as to settings that prevent this from even appearing?  This is on a Windows 2008 server
Jeffrey CoachmanMIS LiasonCommented:
Sorry, I though I posted here saying that I could not recreate this here at work.
sterlingalstonAuthor Commented:
No worries all.  Figured it out.

It's a very complex database and there were some setting issues.  

For the record, if you have a form that loads when the database opens and the form loads a custom tab when opened, then it may appear that your customUI is not working.

The solution: either disable the form from opening in your current database options (Access 2013)
-or-
change the RibbonName option in the form properties to select your customUI

else you will be frustrated, especially as a novice

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sterlingalstonAuthor Commented:
this fixed the issue
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.