Problem executing callback function using Ribben in Access

I had this question after viewing How to load custom images in Access 2007 ribbon.
I have already a customized ribbon but in search for the use of custom pictures I implemented the solution in this answer. I copy and paste both, the Ribbon XML in to the my Ribbon XML and also the VBA code in the module. I have given it, it's own module with the same name.
Working with ACCESS2010, my custom Ribbon stil works, but when I choose the added tab with the custom picture I get an error message.

"myDataBaseName can not execute callback function onGetImage"

Please advise
Who is Participating?
Fabrice LambertConnect With a Mentor Fabrice LambertCommented:
After looking at your database, you are missing the Microsoft Office Object Library reference.

Plus Ribbon Creation Wizard reported 2 errors:
Element splitButton(FileSaveAsMenuAccess) must contain at least 1 element of type : (button, toggleButton)
Element splitButton(FileSaveAsMenuAccess) must contain at least 1 element of type : (menu)
Fabrice LambertFabrice LambertCommented:

First, when working with ribbons, you should not write the XML by hand, but use tools that will do the work for you, such as:
- Ribbon Creator:
- Ribbon creation wizard:

Second, is your callback function properly defined ? In a standard module ?

Last, uploading your database (with anonymized or dummy data) might help.
ste5anSenior DeveloperCommented:
It's hard to tell, what's missing without sample..

here's my reference implementation.

And as Fabrice already pointed out: Writing the ribbon XML by hand is problematic to get right. Even when it is well-formed and valid, it does not necessarily works. Here you need patience and a lot of trial and error.
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jkruijtAuthor Commented:
Hi Fabrice,

Ofcourse it is more usefull to handle a Ribbon with a Ribben developer tool. But at this point I have an working solution and I only try to add a custom picture to a singel button.
I have added a sample data base with the working Ribbon. The last tab is giving me trubbles with the custom picture.

ste5anSenior DeveloperCommented:
As Fabrice already posted: How should it work without LoadPicture() method?

And why didn't you look at my sample?  Use a global image load callback.

btw, use Option Explicit. Add it to every existing code-behind and module. Activate it to be added automatically for new code files in the VBA IDE under Tools\Options\Require Variable Declaration. Also use error handling.
jkruijtAuthor Commented:
Hi ste5an,
the ribbon just works fine only the picture for the button does not show. Instead of that, the message: "myDataBase can not execute callback function onGetImage".
With respect to your solution, I find it a bit difficult solution for a problem that should be solved in a more simple matter.
jkruijtAuthor Commented:
@Fabrice: indeed, that is the problem. I did not had a reference to the Microsoft Office Object Library.
ThX! It is working now.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.