Put image in VBA userform from Copy/Paste - Mismatch error

Ched9

New Member
Joined
Mar 30, 2017
Messages
2
Hi!

I need your help to put a picture in an image section in a VBA userform.

I copied some cells and pasted-as-picture (named Image1) in an Excel spread sheet ("Pic"), and I need that to be in the Userform in the Image1 box.
I am using this line of code for that:

Image1.Picture = LoadPicture(Worksheets("Pic").Shapes("Image1"))

When I try to run it, I have a mismatch error which makes me believe that maybe the copy/paste-as-picture format is not supported as image in the userbox...
I don't know what to do as the image has to come straight from the Excel document (continuously changing - but always named Image1)

Any advice on how to solve that?

Thanks!
Ched
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I really do not think you can do that.
Why not have a Multicolumn listbox
 
Upvote 0
I am using conditional formatting in the original cells, it's quite graphic...
When I tried the multicolumn listbox , only the data would show and not the layout of the cells :/
 
Upvote 0
That is true. Maybe some one else has an answer but I believe I have seen this qusestion before and have never seen an answer to meet you needs.
I am using conditional formatting in the original cells, it's quite graphic...
When I tried the multicolumn listbox , only the data would show and not the layout of the cells :/
 
Upvote 0
Do a forum search for the word OleCreatePictureIndirect .. You'll find some examples that hopefully you can adapt to your need
 
Upvote 0

Forum statistics

Threads
1,215,583
Messages
6,125,664
Members
449,247
Latest member
wingedshoes

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