Macro on protected sheets

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?
 
F

Frank Kabel

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
 
W

Warren

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
 
W

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
 
F

Frank Kabel

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