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.....
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.....