Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2008

Tip: Looking for answers? Try searching our database.

What has my macro done to my password?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tonso - 25 Jan 2008 22:06 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
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.