Programmatically sign a macro - Macro signing automation RRS feed

  • Question


    Hi All,

    Currently, we are doing signing the excel macro file manually, is there any way to automate this macro signing?

    Is there any tool(like signtool) or API to facilitate automate the macro signing?

    your help appreciated.




    Thursday, December 2, 2010 6:11 AM

All replies

  • Try to use a signed template as the basis of your project.
    HTH, Bernie
    Thursday, December 2, 2010 4:51 PM
  • Hi Kirubanandam,

                After reading your post, I knew that you want to sign a macro programmatically. And have you resolved your issue yet?

                Actually, I am not very expert about the sign issue, but I have collected some articles about it:

    RE: Programmatically signing Excel VBA Macro


    How to add a digital signature to a custom macro project in Office 2003 and Office XP


    How to digitally sign Excel macros


    Description of digital signatures and code signing in workbooks in Excel


                I hope these can help you to resolve your problem and feel free to follow up.

    Best Regards,

    Bruce Song

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Proposed as answer by Bruce Song Wednesday, December 8, 2010 7:09 AM
    • Marked as answer by Bruce Song Thursday, December 9, 2010 9:45 AM
    • Unmarked as answer by Bruce Song Thursday, February 3, 2011 9:15 AM
    Monday, December 6, 2010 9:46 AM
  • I am sorry, but both answers do not seem to relate to Kiruba post.

    The first post Bruce quotes even contains the same question - but no answer.


    I am also looking for a way to automatically sign a lot of macros on a server - without manually clicking Developer>Tools>Digital Signature for wach one.




    Thursday, February 3, 2011 9:01 AM
  • Automatically Sign is possible , but the problem is How to sign the Individual VBA Macro (programmatically) 

    I have .dotm file but unable to attach macro with that specific file 

    Following Code I used to Import Digital Certificate into Local Machine 


    using System.Security.Cryptography.X509Certificates;

    private static void InstallCertificate(string certFileName)

    X509Certificate2 certificate = new X509Certificate2(certFileName);
    X509Store store = new X509Store(StoreName.TrustedPublisher, StoreLocation.LocalMachine);

    • Edited by Kashif Agha Friday, February 26, 2016 11:24 PM
    Friday, February 26, 2016 11:23 PM
  • Have you ever figured this out? I also want to sign a bunch of excel and word files containing vba code on a server. I obviously do not want to do this manually on thousands of files.

    Thank you

    Thursday, June 22, 2017 7:46 PM
  • Hey Marc,

    there is an third party vendor, which provides a full automated solution for signing VBA macros for all office files. You can find him here: https://www.proware-solutions.de/produktuebersicht/office-vba-security-compliance/

    As far as I know, they are currently the only one who are providing a software for that.

    Hope that helps.

    Friday, October 20, 2017 5:44 PM