Hello,
Can someone please help me?
I am writing a Macro in Excel using VB 6. This Macro does some basic copy and pasting; however, the worksheet is password protected. The Macro needs to unprotect the sheet, copy & paste, and then re-protect the sheet with a password. I created a simplified example to attempt to get this Macro to work and am not having any luck. The error, "The password you supplied is not correct. Verify that the CAPS LOCK key is off and be sure to use the correct capitalization" keeps appearing. The password in the code is the correct password.
Here is my sample code:
Sub PROTECTION()
ActiveSheet.Unprotect (at)
Range("A1:A3".Select
Selection.Copy
Range("A5".Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Protect (at), DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("B12".Select
End Sub
Please advise... I will greatly appreciate the help. Thanks.
Can someone please help me?
I am writing a Macro in Excel using VB 6. This Macro does some basic copy and pasting; however, the worksheet is password protected. The Macro needs to unprotect the sheet, copy & paste, and then re-protect the sheet with a password. I created a simplified example to attempt to get this Macro to work and am not having any luck. The error, "The password you supplied is not correct. Verify that the CAPS LOCK key is off and be sure to use the correct capitalization" keeps appearing. The password in the code is the correct password.
Here is my sample code:
Sub PROTECTION()
ActiveSheet.Unprotect (at)
Range("A1:A3".Select
Selection.Copy
Range("A5".Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Protect (at), DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("B12".Select
End Sub
Please advise... I will greatly appreciate the help. Thanks.