Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    56

    Unanswered: Can't see message bar with security warning

    Excel 2007. I have a file with a form and button that opens another Excel file and then closes itself. Files reside in separate folders and each folder is NOT trusted. Neither file is digitally signed. When I open each file directly, I see the Security Warning message bar to click to enable macros. All's good. (Both files have Open event macros.)

    Problem is when I open the second file from the first one's form/button. I do NOT see any message bar so there's no way for me to enable the macros to run the second file's Open event code.

    Note that when first file opens it sets
    1) Application.DisplayFullScreen = True and
    2) Application.WindowState = xlMaximized
    ...but before I run open code (Workbooks.Open FileName:=gUsersFile) from first file I set
    1) DisplayFullScreen =False to allow message bar to show
    2) and ScreenUpdating = True

    But I still don't see the security warning button. Again, I *want* to see the security warning so I can click to enable the code! But the message bar is NOT there!!!

    Any ideas what code is needed or setting changed to ensure the message bar appears in the second file?

    Thanks in advance for your help.

  2. #2
    Join Date
    May 2004
    Posts
    56
    SOLVED:

    I found the solution the next day myself. AutomationSecurity is required.

    Here is the code that seems to work for me.
    ================================================== ==

    Application.AutomationSecurity = msoAutomationSecurityByUI

    Workbooks.Open Filename:="C:\Users\xl\Documents\aaa.xlsm"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •