Problem using protect/Unprotect in excel 97

S

spyrule

Hello,

I have tried like 100+ methods of using the protect/unprotect function
in excel 97 vba. ALL of them give me different errors.

If I want to include a simply function to Unprotect and then
re-Protect
something during a given function, What is the "proper" command for
this,
that is excel 97 vba compatible?

Also, I'm assuming that to make it with NO password, use
password:=""?

Thanks in advance,

Spyrule
 
P

Peter T

Did you try the macro recorder. If not record protect & un-protect the
sheet. In the code as recorded might want to change ActiveSheet to
Worksheets("SheetName").

If your function is used as a UDF it can only return a value and cannot
change formats or settings such as protection, but no problem from a sheet
change/selection event.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top