Multiple Digital Signatures and Protected Worksheet

EverythingExcel

New Member
Joined
Jan 23, 2020
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Thanks for this awesome forum! I have Excel 2016 on a Windows 10 machine to which I do not have Admin access. I'm very comfortable with Excel, but haven't used VBA or macros very much, at all... so please talk slowly if you suggest those methods as a possible solution. ;) I have a lot of hours invested in creating a 2-page document that is used in my office as an approval process with lots of detailed information. This form requires four sequential signatures. Each one is dependant on the other layer of approval, before it can be routed to the next person. Unfortunately, I haven't figured out how to incorporate multiple valid signatures in a single Excel document because the document is unable to be edited, after the initial signature. Therefore, we've been forced to print the document and pass the hard copy around the office for wet inked signatures, until the document is complete. It would be great if I can determine a method of incorporating the multiple signatures, but there's another catch....

Majority of the information on the document that we've created is important and needs protected. Therefore, I've formatted the locked cells onto the worksheet and added a password to protect the worksheet and also a password to protect the workbook from structural changes and from seeing hidden worksheets. Before I "protected" the worksheet, I added a single digital signature to the document, but after the worksheet was protected, the signature was no longer able to be signed. Has anyone ever been successful with adding digital signatures onto a protected worksheet and still have the digital signature fully functional, after the protection is enabled? Thanks in advance for your thoughts on these two topics!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Maybe this code witll help?

VBA Code:
Function AddSignature(ByVal strIssuer As String, _
strSigner As String) As Boolean

On Error GoTo Error_Handler

Dim sig As Signature

'Display the dialog box that lets the
'user select a digital signature.
'If the user selects a signature, then
'it is added to the Signatures
'collection. If the user does not, then
'an error is returned.
Thisworkbook.Worksheets ("put the sheet name for the signature here").Unprotect ("password")  '<=== This will let you edit the protected sheet!
Set sig = ActiveDocument.Signatures.Add

'Test several properties before commiting the Signature object to disk.
If sig.Issuer = strIssuer And _
sig.Signer = strSigner And _
sig.IsCertificateExpired = False And _
sig.IsCertificateRevoked = False And _
sig.IsValid = True Then

MsgBox "Signed"
AddSignature = True
'Otherwise, remove the Signature object from the SignatureSet collection.
Else
sig.Delete
MsgBox "Not signed"
AddSignature = False
End If

'Commit all signatures in the SignatureSet collection to the disk.
ActiveDocument.Signatures.Commit

Thisworkbook.Worksheets ("put the sheet name for the signature here").Protect ("password")  '<=== This will protected sheet again!
Exit Function
Error_Handler:
AddSignature = False
MsgBox "Action canceled."
Thisworkbook.Worksheets ("put the sheet name for the signature here").Protect ("password")  '<=== This will protected sheet again!
End Function
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,182
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top