I have a simple macro doing a text to columns function, but it won't run when the sheets are protected. Is this the way it's supposed to be? Is there a way I can change it? There's 2 worksheets using the same macro.
I use the code above to uprotect, run macro, and protect again, including the password. Now when I manually go to unprotect the worksheet, it tells me the password is incorrect. I have done this with both with and without the Password = "password" -- that is
Those two things you've tried aren't going to make a difference. If you follow the .Protect bit with something in quotes, the "Password=" bit is implied. (In other words, they're the same, with or without.)
What I would suggest is go into the code and look closely at the password you wrote in the code and make sure when you're doing it manually you're using the correct spelling, text case etc.
Post back for more ideas if that don't work, but that's the most likely case.
I faced the same problem as did m_woychick, when using this Code. And I am positive that the password that I entered into the Code and the one that I used to manually unprotect the sheet is the same.
How to solve this problem? Else, the worksheets are forever locked!
I found a macro on this site to remove a password. I found that the code would work as long as I didn't include the password = part. I think the way the example reads in this posting it is not consistent--when you remove protection and then reset it. Anyway, that's what I did and I'm using it now without problems.