?
Solved

VBA LoadPicture with .PNG files

Posted on 2011-04-27
5
Medium Priority
?
8,684 Views
Last Modified: 2012-06-27
I need to load a .PNG file as a logo to an Excel UserForm using LoadPicture. .JPG files seem to be fine.

Please where am I going wrong?
0
Comment
Question by:NormanMitchell
  • 3
5 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35475939
You're not - LoadPicture does not recognise png files. You'll need to use a different format if possible.
0
 
LVL 5

Accepted Solution

by:
wellous earned 2000 total points
ID: 35498853
Hi Norman,

the png file format is the one to use, but VBA's standard LoadPicture function is unable to load png files. pls check the attachment ..this download contains a VBA module which uses the GDI+ Windows API to provide a LoadPictureGDI function. You can include this module in any of your VBA projects and use LoadPictureGDI(filename) instead of LoadPicture(filename) to load most image formats (including png) as an IPicture object. By doing that, you can use full-fidelity transparent images in your RibbonX callbacks.


LoadPictureGDI.zip
0
 
LVL 5

Expert Comment

by:wellous
ID: 35498856
good luck
Wellous
0
 

Author Closing Comment

by:NormanMitchell
ID: 35499752
Experts Exchange comes up with the solution yet again!
0
 
LVL 5

Expert Comment

by:wellous
ID: 35500631
Thank you Norman for the points and the grade :)
glad to help,
Wellous
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question