I created a macro, and used the Activesheet.Unprotect Password:="trip"
to protect it. But, I left out the : after "Password". When i tried to
run the macro i got a debug message. Now, "trip" will not unprotect my
sheet, and i have no idea how to get it unprotected. Can anypone
figure out what the password has been changed to?
Thanks,
Tonso
Tonso - 25 Jan 2008 22:15 GMT
> I created a macro, and used the Activesheet.Unprotect Password:="trip"
> to protect it. But, I left out the : after "Password". When i tried to
[quoted text clipped - 4 lines]
> Thanks,
> Tonso
I should add that i also left out the : after Password when I wrote
the Actvicesheet.Protect=:"trip"
Tonso
Dave Peterson - 25 Jan 2008 22:20 GMT
I bet you used:
Activesheet.Protect Password = "trip"
(not .unprotect)
You could either use code:
Activesheet.Unprotect Password = "trip"
or manually unprotect it using
FALSE
(all upper case)
Password = "trip"
is essentially a boolean comparison.
And since Password hasn't be declared, excel sees it as empty. So that boolean
comparison evaluates to FALSE.
If you add
Option Explicit
to the top of your module, then your code wouldn't have compiled--you would have
to declare all your variable explicitly. Excel/VBA would have seen Password as
an undeclared variable and you would have been safe(r).
> I created a macro, and used the Activesheet.Unprotect Password:="trip"
> to protect it. But, I left out the : after "Password". When i tried to
[quoted text clipped - 4 lines]
> Thanks,
> Tonso

Signature
Dave Peterson
Tonso - 30 Jan 2008 13:58 GMT
> I bet you used:
>
[quoted text clipped - 32 lines]
>
> Dave Peterson
Dave,
You are right! Thanks immensely!
Tonso