(Win XP, O2003 SP3 UK)
Hi,
In Excel I have an ‘admin’ menu and a sub menu point ‘Protect/unprotect’ worksheets. With this single menupoint the user to be able to toggle the worksheets of a protected workbook between protected and unprotected states – provided he has sufficient user rights (being on a postive list of users).
My code right now looks like this – but it doesn’t work as intended.
For Each c In arrSheets
‘Sheets will be protected
If Worksheets(“Funds”).Protect = True Then
Worksheets(c).Protect Password:=APP_PWDPROTECT
Else
‘Sheets will be unprotected
Worksheets(c).Unprotect Password:=APP_PWDPROTECT
End If
Next c
To me it seems that the .Protect/ .unprotect methods don’t have a way of testing whether a worksheet is protected or not, eg. by returning a boolean or the like – it can only set .protect or .unprotect.
Does anyone know of a clever way to do this kind of toggling (without having to promp the user) :rolleyes:.
BR