none
Digital Certificates /signatures for Microsoft Office VBA code - with mixed results on code running RRS feed

  • Question

  • --- Environment/ Background ---

    On Office/Excel 2013

    All excel files with macro code are all signed with the same Company Digital Certificate with the same Thumbprint.

    The spreadsheets have buttons for users to click to run the macros/reports.

    Excel Macro Settings updated to ‘Disable All macros except digitally signed macros’. Updated by Group Policy.

    Located in menu File, Options, Trust Center, Trust Center Settings..., Macro Settings

    --- Issues/Findings ---

    New excel files created in excel 2013 with code macros saved as .xlsm formats, click the buttons the code runs successfully.

    Old Excel files with macros still being used have mixed results

    --- Findings --- 

    Excel 97 - 2003 saved as .xls format, click the buttons the code runs successfully.

    --- Issue 1 ---

    Excel 97 - 2003 saved as .xls format

    Click the button, the result the Excel message displays  ‘Cannot run the macro ‘macro name’. The macro may not be available in this workbook or all macros may be disabled.

    If I manually run the code, and click Developer tab, click Visual Basic. click in the modules and run Sub/Userform the code runs successfully.


    --- Issue 2 ---

    Excel files saved as binary format xlsb

    Click the button, the result the Excel message displays  ‘Cannot run the macro ‘macro name’. The macro may not be available in this workbook or all macros may be disabled.

    If I manually run the code, and click Developer tab, click Visual Basic. click in the modules and run Sub/Userform.  The result Errors with ‘The macros in this project are disabled.  Please refer to the online help or documentation of the host application to determine how to enable macros’

    The xlsb I Saved As .xlsm, Click the button, the same result with the Excel message displays  ‘Cannot run the macro ‘macro name’.

    There are many old excel reports in formats as .xls and . xlsb still being used.

    I have no idea where to start analysing this.

    I thought perhaps it’s related to button embedded in the spreadsheet. clutching at straws

    examples of the different button types in the spreadsheets

    any ideas where I can start looking?

    TIA








    • Edited by dd_ Friday, March 16, 2018 6:41 AM
    Friday, March 16, 2018 6:36 AM

All replies

  • Hi dd_,

    I suggest you to first install any pending Office related updates if any available.

    Then again try to apply the group policy and check whether it is working properly or not.

    If issue persist then you can try to save your workbook in newer format and again try to sign it and verify it that issue got resolved or not.

    Let us know about your testing result.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" 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.

    Monday, March 19, 2018 6:43 AM
    Moderator
  • Thanks Deepak

    The latest Windows /Microsofts on installed on the fleet.

    The correct GPO policies are  applied.

    Some of the workbooks Ive already Saved As a new format. For example the binary format xlsb Save As in .xlsx. Reapplied the digital certificate and saved. The results the same issue where the code is unable to run with a valid trusted certificate. on my machine and the users machine.

    TIA


    Monday, March 19, 2018 9:50 PM
  • Hi dd_,

    You had mentioned that,"the binary format xlsb Save As in .xlsx. Reapplied the digital certificate and saved. The results the same issue where the code is unable to run with a valid trusted certificate".

    The .xlsx version will not run any macro code.

    When you save the file in .xlsx format then it will save the file as simple Excel workbook without any code.

    You can try to save it as Macro enabled Workbook (.xlsm) and again try to make a test to verify that whether code is working or not.

    Let us know about your testing result, We will try to provide you further suggestions, if needed.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" 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.

    Tuesday, March 20, 2018 12:58 AM
    Moderator