VBA project created in Excel 2003 doesn't run in Excel 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is my code, it works perfectly in Excel 2003

Private Sub Commandbutton1_Click()
If (Range("S9") = 0) Then
'Unprotect Form 99
Sheets("Form-99").Select
ActiveSheet.Unprotect 5121
'Copy Signature
Sheets("Data Entry").Select
ActiveSheet.Unprotect 5121
Worksheets("Data Entry").Range("N3").Copy
'Paste into Form 99
Sheets("Form-99").Select
ActiveSheet.Range("Q8").Select
ActiveSheet.Paste
ActiveSheet.Shapes("Signature").Select
Selection.Name = "SignatureQ8"
'Protect Form 99
Application.CutCopyMode = False
Selection.Locked = True
ActiveSheet.Protect 5121, DrawingObjects:=True, Contents:=True,
Scenarios:=True
'Update Data Entry & Protect
Sheets("Data Entry").Select
ActiveSheet.Protect 5121, DrawingObjects:=True, Contents:=True,
Scenarios:=True
Worksheets("Data Entry").Range("S9") = 1: Range("T9") = "Signed!"
End If
End Sub

On machines running Excel 2000 I get an error "Run time error 1004"
"The cell or chart you are trying to change is protected and therefore read
only"

From the code I am unprotecting, doing my work and protecting again. It
works fine in 2003, any sugestions on what is happening with 2000? I even
tried saving the file in an earlier version of Excell but this didn't help.
 
Rick,

The password should be a String not a numeric value.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Rick_T" <[email protected]>
wrote in message
Here is my code, it works perfectly in Excel 2003

Private Sub Commandbutton1_Click()
If (Range("S9") = 0) Then
'Unprotect Form 99
Sheets("Form-99").Select
ActiveSheet.Unprotect 5121
'Copy Signature
Sheets("Data Entry").Select
ActiveSheet.Unprotect 5121
Worksheets("Data Entry").Range("N3").Copy
'Paste into Form 99
Sheets("Form-99").Select
ActiveSheet.Range("Q8").Select
ActiveSheet.Paste
ActiveSheet.Shapes("Signature").Select
Selection.Name = "SignatureQ8"
'Protect Form 99
Application.CutCopyMode = False
Selection.Locked = True
ActiveSheet.Protect 5121, DrawingObjects:=True, Contents:=True,
Scenarios:=True
'Update Data Entry & Protect
Sheets("Data Entry").Select
ActiveSheet.Protect 5121, DrawingObjects:=True, Contents:=True,
Scenarios:=True
Worksheets("Data Entry").Range("S9") = 1: Range("T9") = "Signed!"
End If
End Sub

On machines running Excel 2000 I get an error "Run time error 1004"
"The cell or chart you are trying to change is protected and therefore read
only"

From the code I am unprotecting, doing my work and protecting again. It
works fine in 2003, any sugestions on what is happening with 2000? I even
tried saving the file in an earlier version of Excell but this didn't help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top