Hello. I've been trying to find a good way to write some code to get around an issue I've come across. I will briefly explain what works below and why it is - and hope someone can help me generate the right code to get around the issue.
I have a spreadsheet that requires a signature to render the sheet locked and approved. The sheet itself needs to be locked (protected) to avoid formulas and proprietary company data from being observed by all users - with exception of the approving personnel. They have a button to toggle some cells to view finance data, and then the signature button would hide that data and allow them to sign the sheet. The following code allowed the one button to hide the data if displayed in M63:M64 - before signing. However, If the users cancel the signature - the form remains unlocked and the fields / formulas can then be observed. I am trying to figure out how to best LOCK the form, but allow the signature block to be "signed". I can't seem to get both to work... If a user cancels the signature - I don't want people to have an unlocked spreadsheet.. (i know there is some redundant lines in this but i've been hacking away at it for too long (pwd vs password, etc...)

private Sub CommandButton1_Click()
Dim pwd As Variant
Dim ws As Worksheet
Set ws = ActiveSheet
pwd = "123"
ActiveSheet.Unprotect password:="123" !This unlocked the sheet to allow the next two lines to simply hide the data based on format style (works)
Range("M63:M64").Select
Range("M63:M64").NumberFormat = ";;;"
Range("G77").Select !This set the location for the signature block to show up
'ActiveSheet.Protect password:=pwd !This was an attempt to LOCK the form (which does work)
'ws.Range("G77:J83").Locked = True !This was an attempt to UNLOCK the area where the signature block shows up below
ActiveWorkbook.Signatures.AddSignatureLine.Sign _ !This line works to bring up a fully "sign-able" signature
"{00000000-0000-0000-0000-000000000000}"
End Sub

The rub: If the sheet is locked, then I get an error message at the line to bring up the signature block (even if i try to unlock the region in G77). If I move the signature block line BEFORE the lock line - i also get an error message at the line where it tries to lock the form up.

I tried to set up a DO or a FOR loop to iterate through setting the FORMAT of the SHAPE object created since each time you use the file, the signature block generates a new "n" for the picture (per the following lines). I tried this technique to simply have the item selected, then set the shape to FALSE lock - but that didn't work either (first trying to get the code to set up for "Picture " & n based on the unknown n... Then actually get it to set the selection to false...

ActiveSheet.Shapes("Picture 16").Select
Selection.Locked = False
End Sub



If I leave a pre-fabricated signature block on the screen, lock everything except for the picture - I was trying to at least hide it behinds something upon selecting the sign button would reveal it - but that too has been a problem as the signature block seems to ALWAYS be on top of everything - no matter what I try...

I know I wrote a bunch - but any assistance would be greatly appreciated! Thank you for taking the time to read to this point!!!
~D8K