Sign VBA macroses with Digital signature

GroupDocs.SignatureΒ providesΒ DigitalSignOptionsΒ classΒ to specify different amount of settings for Digital signature

  • Class DigitalVBA allows to configure certificate settings for macros signing

Here are the steps to add Digital signature into document with GroupDocs.Signature:

This example shows how to add Digital signature to document.Β SeeΒ SignResult


 using (Signature signature = new Signature(excelFilePath))
{
     DigitalSignOptions signOptions = new DigitalSignOptions();
    //Add extension for signing VBA project digitally
    DigitalVBA digitalVBA = new DigitalVBA(certificatePath, password);
    //Set to true only for signing VBA project
    digitalVBA.SignOnlyVBAProject = true;
    digitalVBA.Comments = "VBA Comment";
    signOptions.Extensions.Add(digitalVBA);

    // sign document to file
    SignResult signResult = signature.Sign(outputFilePath, signOptions);
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in ourΒ GitHub examples:

Free Online Apps

Along with the full-featured .NET library, we provide simple but powerful free online apps.

To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the GroupDocs.Signature App Product Family.