VBA Access To Images Used in Custom Ribbon?

L

Legacy 471763

Guest
Hello All,

I have set up a custom ribbon in an excel file that includes various images as the icons.

I was wondering if it is possible to access these images from VBA? I ask because I am working on a tool that will be used by numerous user's from various countries. There are a couple reports the tool offer's that the user's can print out, which are actually configured on hidden sheets.

To reduce file size and other complications, I would like to create these sheets/reports in real time rather than using a hidden sheet. However, there are a couple images such as company logo's, etc. that I use in the report that I would need to be able to access when needed. If I "embed" the images into the Custom UI File, I was hoping I could then access them in VBA and import them into the report's when needed.

Any idea if this is possible?

Thanks

- Dale
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Interesting question - I don't think you can access the images direct it with VBA but, as Jan Karel suggests in response to a similar question back in 2015 (Calling CustomUI Embedded image using VBA), you would have to extract it from the XLSM file containing image (all XLSM files are in fact ZIP files). I suspect that this is an unnecessary amount of effort for your needs, though, and I would suggest converting the logos, images etc into Base64, and then building that Base64 code into a VBA subroutine that inserts the images for you. I can see if I can pull out an example for you when I get home from work.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top