Try this code if it works for you:
string certFileName = "AsposeDemo.pfx";
string password = "aspose";
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook("sampleDigitallySignedByCells.xlsx");
Aspose.Cells.DigitalSignatures.DigitalSignatureCollection dsCollection = new Aspose.Cells.DigitalSignatures.DigitalSignatureCollection();
System.Security.Cryptography.X509Certificates.X509Certificate2 certificate = new System.Security.Cryptography.X509Certificates.X509Certificate2(certFileName, password);
Aspose.Cells.DigitalSignatures.DigitalSignature signature = new Aspose.Cells.DigitalSignatures.DigitalSignature(certificate, "Aspose.Cells added new digital signature in existing digitally signed workbook.", DateTime.Now);
dsCollection.Add(signature);
workbook.AddDigitalSignature(dsCollection);
workbook.Save("outputDigitallySignedByCells.xlsx");
workbook.Dispose();
I used this nuget package.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.