ercedwards
Board Regular
- Joined
- Apr 27, 2013
- Messages
- 125
I have the following code
This code runs perfectly fine on my laptop. When I move it to another machine it runs fine for a bit and then all of a sudden I get
Paste Method of Worksheet Class Failed at the ActiveSheet.Paste line.
So, in Debug mode if I move the arrow up to Start and press F5 it continues to run fine and then bingo, I randomly get the same error. That's why I added the On Error line but Excel seems to ignore that.
Thoughts? It's driving me nuts.
Code:
Sub AddPicture(ByRef WinType As String, MRow As Integer)
On Error GoTo Start
Start: Sheets("Window Pics").Select
ActiveSheet.Shapes.Range(Array(WinType)).Select
Selection.Copy
Sheets("Mulled Windows").Select
Range("C" & MRow).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
This code runs perfectly fine on my laptop. When I move it to another machine it runs fine for a bit and then all of a sudden I get
Paste Method of Worksheet Class Failed at the ActiveSheet.Paste line.
So, in Debug mode if I move the arrow up to Start and press F5 it continues to run fine and then bingo, I randomly get the same error. That's why I added the On Error line but Excel seems to ignore that.
Thoughts? It's driving me nuts.