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
J.
John KruijtAsked:
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.

Fabrice LambertFabrice LambertCommented:
Hi,

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: http://www.ribboncreator2016.de/en/
- Ribbon creation wizard: http://arkham46.developpez.com/articles/office/assistant-ruban/

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

Last, uploading your database (with anonymized or dummy data) might help.
0
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.
EE29091762.accdb
0
John KruijtAuthor 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.

ThX
DWH_back-up.accdb
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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.
0
Fabrice LambertFabrice 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)
0

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
John KruijtAuthor 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.
Regards,
J.
0
John KruijtAuthor Commented:
@Fabrice: indeed, that is the problem. I did not had a reference to the Microsoft Office Object Library.
ThX! It is working now.
0
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.