I am working on Excel File and VBA. Can anyone tell me what's wrong with following command:
Private Sub optMonday_Click()
Sheet1.Unprotect
'Now here I want to enter some values.....and in the next line want to re-protect sheet....
Sheet1.Protect
End Sub
Tha above always displays an error as:
Method 'Unprotect' of object '_Worksheet' failed
similarly, Method 'Protect' of object '_Worksheet' failed 'when I try to Protect it......
Please let me know, how I can Protect and Unprotect the Sheet dynamically...
Thanx in advance.