Solved

Use a picture within a spreadsheet on an Excel user Form (load on Initialize)

Posted on 2011-02-15
4
377 Views
Last Modified: 2012-06-21
I'm trying to use a picture that's stored within a spreadsheet in a User Form. I know how to reference pictures as files on User Forms, but in this case I want the Excel file to be self contained so I don't have to ship the picture file seperately.

If I have Picture_1 in Sheet3 how would I call this to load into my image placeholder on the User Form_Initialize?

Sorry if this is really simple but it's baffling me!

Cheers

Pete
0
Comment
Question by:pfmurray
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
How is the picture stored in the worksheet? If it's in an ActiveX Image control, then you can simply assign the Picture property from one to the other; if not, then you need a lot of API code.
0
 

Author Comment

by:pfmurray
Comment Utility
Hi Rory - very prompt as always!

At the moment it's just a pic inserted into the worksheet from a jpg file. Is there something I need to do to make it available without a lot of code?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
Comment Utility
If you add an image control to the worksheet, then load your picture into that, it is much easier to pass it to the image control on the userform. Mind you, you could also just load it into the userform directly unless you need to switch images?
0
 

Author Closing Comment

by:pfmurray
Comment Utility
Sometimes you just need someone to state the obvious and it clicks. Thanks Rory!  I just loaded it into the form and that solved it. I was going wrong because I was thinking I had to load the image every time the form was called. Not true!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now