Marc,
From VFP and with Automation, I use this:
if type([oExcel.commandbars("Protection").Controls("Protect Sheet...")]="O"
.....
Do not know about the equivalent of VFP TYPE function in VBA, so in VBA you probably need to loop through all Controls and to check for existence of "protect sheet" or "unprotect sheet" names.
>I use the command ActiveSheet.UnProtect at the beginning of my code. But if the user does not enter the password, then the rest of the code is also executed. I would like to put a IF command line to stop the execution of the code... I wonder what is the property to know if my active sheet is protected or not?