I’m seeing a null reference exception when trying to sign a vba project. I amended the code from your docs, to create a workbook from scratch rather than loading an existing one:
#if true // Sign
X509Certificate2 cert = new X509Certificate2(@“SampleCert.pfx”, “1234”);
DigitalSignature ds = new DigitalSignature(cert, “Signing Digital Signature using Aspose.Cells”, DateTime.Now);
wb.VbaProject.Sign(ds); #endif // Save the workbook
wb.Save(@“SampleSigned.xlsb”);
}
Note:
If I create a spreadsheet using Excel and add the above VBA code using the Visual Basic IDE, and then load and sign using Cells, it works (as in example). But.. creating the above spreadsheet with aspose cells, and saving it and then loading it again to sign also fails with an exception.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.