VBA Paste pictures help

Arul.rajesh

Active Member
Joined
Sep 20, 2011
Messages
285
when i use the

ActiveSheet.Pictures.Insert("C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg").Select

It inserts the picture as a link in the file. Is there any way to embed the actual picture in the file?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
If you mean Embed as an object then try like this:
Code:
Dim olePic As OLEObject
Set olePic = ActiveSheet.OLEObjects.Add(Filename:= _
        "C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg", Link:= _
        False, DisplayAsIcon:=False)
 
Upvote 0
If you mean Embed as an object then try like this:
Code:
Dim olePic As OLEObject
Set olePic = ActiveSheet.OLEObjects.Add(Filename:= _
        "C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg", Link:= _
        False, DisplayAsIcon:=False)

thank you very much.
 
Upvote 0
IT works but now I dont see the picture as when i simply paste the picture. but an OLE object the picture doesnt show unless double clicked on and opens in windows piture viewer
 
Upvote 0
IT works but now I dont see the picture as when i simply paste the picture. but an OLE object the picture doesnt show unless double clicked on and opens in windows piture viewer

I am a bit confused. What do you want to achieve?
 
Upvote 0
when i use the

ActiveSheet.Pictures.Insert("C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg").Select

It inserts the picture as a link in the file. Is there any way to embed the actual picture in the file?

used the
Code:
activesheet.shapes.addpicture
worked like a charm
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,930
Members
449,479
Latest member
nana abanyin

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