S
Stefi
Hi All,
I found Dave Peterson's post saying there is no other way to check if a
worksheet is protected with a given password than try to unprotect it. I
wrote a sub for this purpose and it worked. I tried to recreate it in
function form and it also worked, although it made changes to the worksheet
(namely unprotected it) and functions don't do that in other cases. Finally I
tried to use it as a worksheet function (UDF), but it did not worked that way.
My questions:
1. Why does it work as a standard VBA function?
2. Why does not it work as an UDF? How could I make it work that way?
Thanks,
Stefi
I found Dave Peterson's post saying there is no other way to check if a
worksheet is protected with a given password than try to unprotect it. I
wrote a sub for this purpose and it worked. I tried to recreate it in
function form and it also worked, although it made changes to the worksheet
(namely unprotected it) and functions don't do that in other cases. Finally I
tried to use it as a worksheet function (UDF), but it did not worked that way.
My questions:
1. Why does it work as a standard VBA function?
2. Why does not it work as an UDF? How could I make it work that way?
Thanks,
Stefi