Macro on protected sheets

  • Thread starter Thread starter Warren
  • Start date Start date
W

Warren

I have macros written in excel 97 & 98 that when I run
them in excel 2000 it bombs out.
I have up to now established that it has something to do
with the worksheet protection. Once I disable the
protection then the macro runs. I have also checked that
the cell being utilised in the macro is unprotected!
PLease help?
 
Hi
to give you a more precise answer it would be helpful if you post the
relevant part of your macro whcih creates the error.
You may use the statements
Activesheet.unprotect password:="yourpassword"

and
Activesheet.protect password:="yourpassword"

at the beginning and the end of your macro
 
Thank you Frank, but I still have a problem that when I
add those commands when I run the macro it gives me
an "400" error. I can only assume that it has something to
do with the protecting function, is this the correct
command? Please advise?

Warren
 
Hi,

I have done as you requested however I am still getting
a "400" error. This seems to be the problem with the
protecting command of the macro. I tested the unprotect
part and it works well, it is now the protection part that
is a problem! Please advise as to what the correct syntex
would be to protect the worksheet.

Regards,

Warren
 
Hi Warren
as written per PM please post your code. The syntax from below should
work
 

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

Back
Top