Oh no! Need help on unprotect password protection

  • Thread starter Thread starter jasonsweeney
  • Start date Start date
J

jasonsweeney

I was fooling around with some code to protect all of my worksheets,
except unlocked cells.

Somehow, in error, I programmed a password into each sheet to
unprotect.

I have never put a password in any of the sheets.

the code that I think caused this was
_____

Sheet1.protect enable selection = xlUnlockedCell

_____

Did this code somehow set my password to something? How do I undo?
 
Jason,

That line would cause a syntax error.
I'm guessing you've actually got two lines.
Sheet1.protect enable
selection = xlUnlockedCell

The password could be set to whatever the variable 'enable' was set to.

If earlier in your code you have written something like:
enable = "True"
or
enable = "Yes"

Then perhaps that's what your password is?

You might like to look up online help for the Protect method.
 
Ok. I found a password finding tool on these threads (thank god).

New question:

Can someone show me some code that protects each sheet (not using a
loop) and makes it so that only unlocked cells can be selected??
 
jason,

The following will allow editing in only unlocked cells:

ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect UserInterfaceOnly:=True
ActiveCell.Select

If you want to do it on multiple sheets, you'll have to activate
each of them and do it or use a loop.

John
 
Is that actually the code you used or did you have

Sheet1.protect enableselection = xlUnlockedCell

If the latter, it is possible that this would be interpreted as

Sheet1.protect password:=True

since enableselection and xlUnlockedCell would both be seen as uninitialized
variables and:

? enableselection = xlUnlockedCell
True


In any event you can try

Sheet1.Unproted enableselection = xlUnlockedCell
 
Tom,

I still don't know what I did with that. Excel clearly thought
programmed a password. I found a quick a dirty "brute force attack
password macro on these threads and used that. It said the passwor
for those sheets was "AAAAAAAABABF". Weird. Thnaks for the rest o
the code, sheets are working good now
 
Back
Top