Hi,
I am having problems with protection of sheets in VB...
I can protect/unprotect sheet no. 3 no problems. As soon as I add the protection on sheet1 I get the following error.
Runtime error '32809'
Application or object-defined error
Now the code does not seem to have any funnies in but it keeps on chrasing at the protection for sheet1....
Here is the code...
'Unprotect sheet
Sheet3.Unprotect Password:="password"
'Record data into Database
Sheet3.Range("a1:j1").Copy
Sheet3.Range("a65000").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Clear input sheet
Sheet1.Unprotect Password:="password"
Range("v1").Value = 0
Range("w1").Value = 0
Range("h10:j12").ClearContents
Range("f16:j18").ClearContents
Range("f22:l25").ClearContents
Sheet1.Protect Password:="password"
'Protect sheets
Sheet3.Protect Password:="password"
Any reason it would carsh on 1 but not on 3?
I am having problems with protection of sheets in VB...
I can protect/unprotect sheet no. 3 no problems. As soon as I add the protection on sheet1 I get the following error.
Runtime error '32809'
Application or object-defined error
Now the code does not seem to have any funnies in but it keeps on chrasing at the protection for sheet1....
Here is the code...
'Unprotect sheet
Sheet3.Unprotect Password:="password"
'Record data into Database
Sheet3.Range("a1:j1").Copy
Sheet3.Range("a65000").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Clear input sheet
Sheet1.Unprotect Password:="password"
Range("v1").Value = 0
Range("w1").Value = 0
Range("h10:j12").ClearContents
Range("f16:j18").ClearContents
Range("f22:l25").ClearContents
Sheet1.Protect Password:="password"
'Protect sheets
Sheet3.Protect Password:="password"
Any reason it would carsh on 1 but not on 3?