none
Code sign an Excel 2013 macro project the digital certificate not saving/ applying RRS feed

  • Question

  • I have an excel 2013 template with code in the excel start-up location

    C:\Program Files (x86)\Microsoft Office\Office15\XLSTART\Book.xltm

    I open the workbook that contains the macro project I want to sign.

    1. Open the Visual Basic Editor

    2. Click the Tools menu, click Digital Signature…

    3. Click Choose…

    4. Select the digital certificate

    5. The result display in The VBA project is currently signed as

    Certificate name: <the digital certificate >

    6. Click OK

    7. Save the code

    Close the template

    Close excel

    When I reopen the template to check, the template is no longer signed. The digital certificate has been removed.

    I did the same steps to apply digital signatures to my Word templates. When I check the digital signature remains.

     

    For the excel template how can I get the digital certificate to remain and 'stick'. Any ideas what Im doing wrong .

    TIA

    Tuesday, September 26, 2017 3:17 AM

All replies

  • Hi dd_,

    When you open a template file, in fact you are opening a copy of the template. I would suggest you save the file as a template file(.xltm) after signing the opened file.

    Best Regards,

    Terry


    MSDN Community Support Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 28, 2017 1:03 AM
  • Thanks Terry

    so...

    If I go to Windows Explorer  file location C:\Program Files (x86)\Microsoft Office\Office15\XLSTART\Book.xltm

    Right mouse click on the file, the Windows shortcut menu displays. I click Open

    The result is, in Excel the file opens and in the Windows title bar displays Book.xltm

    Are you saying Im not opening the excel template and its only a  copy of the template? Is this for excel only. As I do the same steps for Word templates and it appears to open the orginal Word template

    Thanks again Terry.

    Thursday, September 28, 2017 1:17 AM
  • Hi dd_,

    Sorry for mine misunderstand. If you use Open to open the template file, it is not a copy file.

    I tried your steps with different certificates, most of them succeed signing the file and the template remain signed after saving and reopening the template file. Besides, when I use a corrupt certificates to sign the file, I got a error message like this when saving the file, and then the digital certificate has been removed. Did you ever get this message?

    Besides, the forum is for development issues related to Excel Object Model, I would suggest you post on  Excel IT Pro Discussions for more help for this issue. Thanks for understanding.

    Best Regards,

    Terry


    MSDN Community Support Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, September 29, 2017 8:57 AM
  • Hello Terry

    When I apply the digital signature no messages appear.

    The digital signature is applied via the Visual Basic IDE, therefore I thought this forum would provide solutions

    Ill post in the Excel IT Pro Discussions forum and see what the responses are.

    Many thanks again Terry

    Sunday, October 1, 2017 10:56 PM