We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Digitally signing VBA Project

I am able to sign the VBA project in a workbook when using the .net framework, but in a .net core app, I am getting a not implemented exception.

Can you confirm this. Any idea when it will be implemented in .net Core?

Thanks,
Dean

@Moonglum,
This feature is available in Aspose.Cells for .NET Core since version 20.4 and following code compiled fine with the latest version 21.8. Could you please share which version are you using at your end? If not using the latest version, please give it a try and share your comments.

String password = "pw";
string pfxPath = "yourPFXPath";
string comment = "Signing Digital Signature using Aspose.Cells";

//please use this constructor.
DigitalSignature ds = new DigitalSignature(File.ReadAllBytes(pfxPath), password, comment, DateTime.Now);

Workbook wb = new Workbook("srcFile.xlsm");
wb.VbaProject.Sign(ds);

wb.Save("outFile.xlsm");

I was using the certificate constructor, which worked on .net framework:

3.png (12.9 KB)

It looks like same constructor is not implemented in .net core:
2.png (22.1 KB)

The constructor you provided always throws pad block corrupted on both .net framework and .net core:

pad.png (17.5 KB)

Oh, an I am using 21.8.0.0

@Moonglum,
I have checked it again and this constructor is working with Aspose.Cells for .NET Core 21.8. If your issue is not resolved, please share a complete solution along with the referenced libraries for our testing. This solution should have a simple console application having this code only for better under standing the issue. We will check the scenario and share our feedback. You may upload the compressed solution to some public file sharing server and share the download link here.