run-time error '1004': Paste method ow Worksheet class failed

r_simpson42

New Member
Joined
Sep 25, 2013
Messages
8
One user (of many) receives the run-time error '1004': Paste method of Worksheet class failed
on the line "ActiveSheet.Paste" (see below for example macro)
I have many users here at work that use a whole slew of these types of macros as tickmarks in their Excel workpapers. They work for everyone, except one.
The macro is supposed to paste a small image (.png) into the excel worksheet.
Any ideas what could case this?
The macro is written in the below fashion in order to display the image on computers that do not have the macros and .png files installed on them.
Sub Senior_Ties_to_Prior_Year()
'
' Senior_Ties_to_Prior_Year Macro
'
'
ActiveSheet.Pictures.Insert("C:\Tick marks\Green Prior Year.png").Select
Selection.CopyPicture
Selection.Delete
ActiveSheet.Paste
ActiveCell.Select
End Sub

Thank you for your thoughts and suggestions!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Do they have a protected worksheet ??
Have you tried pasting before deletion ?

Code:
Sub Senior_Ties_to_Prior_Year()
ActiveSheet.Pictures.Insert("C:\Tick marks\Green Prior Year.png").Select
Selection.CopyPicture
ActiveSheet.Paste
Selection.Delete
End Sub
 
Upvote 0
No, the worksheet is not protected, and sometimes the macro does work and sometimes he get the error.
It looks to me like I am pasting before deletion...so not sure what you mean.
 
Upvote 0
your code does this !

Code:
Selection.CopyPicture
[color=red]Selection.Delete
ActiveSheet.Paste[/color]
ActiveCell.Select
I suggested reversing the 2 lines in red !
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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