Off Topic - Excel

Crittar

Member
I know this is off topic but you never know - there might well be someone out there who can help me:

I have developed a macro in excel (2002) which as part of its function 'protects' the sheet using the following code:

Code:
	ActiveSheet.Protect (Password = "secret")
	ActiveSheet.EnableSelection = xlUnlockedCells
	ActiveSheet.EnableSelection = xlLockedCells

The problem is, when I save the sheet and later re-open it, I cannot remove the protection. I am constantly told that the password I specify is incorrect. I have tried doing the unprotect within a macro - still no joy.

Anyone out there have any ideas?
 

Crittar

Member
Solved it!

As is so often the case accurate reading of the manual (or in this case help text) works wonders. The statement should have read:

ActiveSheet.Protect Password:= "secret"
 
Top