Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Activesheet.Unprotect does not work when called from a Userdefined function in a formula

$
0
0

Can anyone explain to me why the following VBA code:

     Function UserFunc(Whatever As Variant)

          ActiveSheet.Unprotect

     End Function

works properly in Excel (i.e. unprotects the non-password-protected active sheet) when called from a form control button-click that calls a VBA Sub that invokes the function; but DOES NOT unprotect the same sheet when invoked by a formula such as "=UserFunc(B3)" on the same sheet?

Thanks,

cw


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>