Insert a JPEG Image from one worksheet into multiple tabs in another worksheet

peter8848

Board Regular
Joined
Oct 7, 2018
Messages
112
Hi,

I have a code as below:

ActiveSheet.Shapes.Range(Array("image1.jpeg")).Select
Selection.Delete

Windows("Formatting Tool.xlsm").Activate
Sheet1.Shapes("image1.jpeg").Copy
Windows("Format File.xlsx").Activate
Range("H8:H8").Select
ActiveSheet.PasteSpecial
Selection.ShapeRange.ScaleWidth 0.8, _
msoFalse, msoScaleFromTopCenter
Selection.ShapeRange.ScaleHeight 0.8, _
msoFalse, msoScaleFromTopCentre
Selection.ShapeRange.Left = Range("H8").Left + Range("H8").Width / 2 - Selection.ShapeRange.Width / 2


Then it stopped at "Sheet1.Shapes("image1.jpeg").Copy" with the error message as below:


"Run-time error '1004

Copy method of picture class failed"

Anyone has any ideas how to fix it? thanks in advance.

I tried to change the code to "

ActiveSheet.Shapes.Range(Array("image1.jpeg")).Select
Selection.Copy

"

Still not working.....
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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