Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ribbon Control Image Error (Invalid Picture)

Status
Not open for further replies.

PercyN

Programmer
May 16, 2007
86
Hi,
I am using the code below to upload images to my custom controls on my custom ribbon in acess 2007 but I keep getting this error message no. 481 "Invalid Image". When I try with a .bmp file it works but all my images are in .png fromat. How can I get around this?

Code:
Function onGetImage(control As IRibbonControl, ByRef image)
    Select Case control.ID
    Case "cmdSalesHome":
        Set image = LoadPicture("C:\Users\user\Documents\My Projects\AutoMate DMS\Calc.png")
    End Select
End Function
 
You could use the LoadImage API call as mentioned here or use the access specific code on the next page of the article (it starts at the bottom of the linked page).

Hope this helps

HarleyQuinn
---------------------------------
Black coat, white shoes, black hat, cadillac. The boy's a timebomb!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before post
 
Thanks.

I tried the first (shorter) method but when I compile, I get an error that highlightd "LoadImage" and says "Sub or Function not defined
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top