none
Macro in Excel 2016 file opened from another excel is blocked RRS feed

  • Question

  • Hello,

    we are using trusted locations in Excel. Despite is file with macro located in trusted location when is opened from another Excel (there is a button which opens workbook) the macro is blocked. There is an error:

     Because of your security settings, macros have been disabled. To run macros, you need to reopen this workbook, and then choose to enable macros. For more information about enabling macros, click Help.

    When we open file directly macro works.

    For example I have macro in file Book1 and if I open directly Book1 macro is working.

    If I open Book2 where I have a button which opens Book1. Macro in Book1 is not working.

    Do you have any idea how to correct this issue?

    Thank you in advance.  



    Thursday, July 12, 2018 8:12 AM

Answers

  • Hello,

    I have found a problematic GPO settings. We have configured Automation Security (located in User Configuration\Policies\Administrative Templates Policy Definitions\Microsoft Office 2016\Security Settings\) to disable all macros. When I changed Automation Security level to "Use application macro security level" everything works fine.

    Best regards,

    Vjekoslav 

    • Marked as answer by VjekoslavV Friday, July 13, 2018 10:54 AM
    Friday, July 13, 2018 10:54 AM

All replies

  • Hi,

    This is the forum to discuss questions and feedback for Microsoft Excel features, I'll move your question to the MSDN forum for Excel

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,

    Emi


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, July 13, 2018 2:31 AM
  • Hello VjekoslavV,

    What's the location? Is it a local location or a network location?

    How do you open the Book1 from Book2? Did you use a macro? If so, what' the code?

    Best Regards,

    Terry


    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.

    Friday, July 13, 2018 8:31 AM
  • Hello Terry,

    I have tested from both locations. The behavior was the same. It looks like some GPO settings protects users to open Excel with macro from another file despite is file in trusted location.

    Yes, I use a macro to open a book1. Here is a code:

    Sub Openworkbook_Click()
        Dim xWb As Workbook
        Dim wbName As String
        On Error Resume Next
        Set xWb = Workbooks.Open("L:\book1.xlsm")
        wbName = xWb.Name
        If Err.Number <> 0 Then
            MsgBox "This workbook does not exist!", vbInformation, "Message"
            Err.Clear
        Else
            MsgBox "This workbook is opened!", vbInformation, "Message"
        End If
    End Sub

    Best regards,

    Vjekoslav

    Friday, July 13, 2018 8:58 AM
  • Hello,

    I have found a problematic GPO settings. We have configured Automation Security (located in User Configuration\Policies\Administrative Templates Policy Definitions\Microsoft Office 2016\Security Settings\) to disable all macros. When I changed Automation Security level to "Use application macro security level" everything works fine.

    Best regards,

    Vjekoslav 

    • Marked as answer by VjekoslavV Friday, July 13, 2018 10:54 AM
    Friday, July 13, 2018 10:54 AM