Posted to microsoft.public.excel.programming
|
|
protect - macro?
ah yes,
I have put them in the sub
whereas before I was trying to put them in a sub of their own which is why
it wouldn't work.
Thanks
--
Stu
"Harald Staff" wrote in message
...
Just like in real life; unprotect the sheet, perform actions, protect the
sheet when done. You should know your own code well enough to spot the
appropriate locations ;-)
--
HTH. Best wishes Harald
Followup to newsgroup only please
"Stu" skrev i melding
...
I haven't got a clue what the users would be using, but the users should
have pretty up-to-date software and OS.
And, where do I put the
Sheets(1).Unprotect Password:="Yo"
'autofilter, hide, stuff
Sheets(1).Protect Password:="Yo"
Thanks
--
Stu
"Tom Ogilvy" wrote in message
...
Why are you talking about users. You said *You* would be using
xl2002,
so
limitations of xl97 were of no consequence. Now you have users - will
they
all also be using xl2002? If not, you have more surprises headed your
way.
Using userinterfaceonly will not work with your autofilter code.
Userinterfaceonly only works with an already existing filter. There
is
no
reason the unprotect shouldn't work if you spell it correctly and the
password is the correct password.
The other method I showed will work with userinterfaceonly, of course.
--
Regards,
Tom Ogilvy
Stu wrote in message
...
That is true I am too paranoid and for no reason, because like you
say
it
is
to prevent fools from messing with things they shouldn't but I know
a
lot
of
fools who will probably venture into the code and mess that up too.
And I cant seem to get the:
Sheets(1).Protect Password:="Yo", _
UserInterfaceOnly:=True
or
Sheets(1).Unrotect Password:="Yo"
'autofilter, hide, stuff
Sheets(1).Protect Password:="Yo"
to work.
Thanks
--
Stu
"Harald Staff" wrote in message
...
You can prevent that in the VB editor menu Tools VBA proj
Properties
Protection. But
I'd prefer hiding or masking the password instead; unlocked code
may
provide you with good
debugging information until the code is perfect.
Anyway, you're too paranoid. Excel is not safe and sheet passwords
can
be
cracked easily.
Security is basically there to prevent fools from doing severe
damage
to
formulas, not to
protect our digital rights.
--
HTH. Best wishes Harald
Followup to newsgroup only please.
"Stu" wrote in message
...
What if the user looks in the code? the password is viewable.
--
Stu
"Harald Staff" wrote in message
...
"It" says ???
You have two options. One is protecting by code, userinterface
only:
Sheets(1).Protect Password:="Yo", _
UserInterfaceOnly:=True
Now macros can do more things than the user is allowed.
Or you can simply have your macro unprotect-work-protect like
this
Sheets(1).Unrotect Password:="Yo"
'autofilter, hide, stuff
Sheets(1).Protect Password:="Yo"
--
HTH. Best wishes Harald
Followup to newsgroup only please.
"Stu" wrote in message
...
Hey guys,
I have this macro and I want my worksheet to be protected
but
it
says I
am
not able to protect the sheet because of the macro.
Is there any way around it?
Thanks
--
Stu
|