H
Hennie Neuhoff
Hi Guys
I'm totally puzzled. Every second time I run this code I get the following
message:
"PasteSpecial method of Range class failed"
However, if I remove ActiveSheet.Protect Password:="dorPseO"
I don't get any error messages
Obviously I'm doing something wrong - Any suggestions?
Public Sub OesOorProdSt()
'Prosedure om pak produktiwiteit oor te dra na kontrole blad
Dim OesStatPro As Range
Range("OesRek!OesStatPro").Copy
Sheets("OesProd").Select
ActiveSheet.Unprotect Password:="dorPseO"
Range("A1").Select
Range("A1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect Password:="dorPseO"
End Sub
I'm totally puzzled. Every second time I run this code I get the following
message:
"PasteSpecial method of Range class failed"
However, if I remove ActiveSheet.Protect Password:="dorPseO"
I don't get any error messages
Obviously I'm doing something wrong - Any suggestions?
Public Sub OesOorProdSt()
'Prosedure om pak produktiwiteit oor te dra na kontrole blad
Dim OesStatPro As Range
Range("OesRek!OesStatPro").Copy
Sheets("OesProd").Select
ActiveSheet.Unprotect Password:="dorPseO"
Range("A1").Select
Range("A1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect Password:="dorPseO"
End Sub