If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Can't see message bar with security warning

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-09, 19:59
paulzak paulzak is offline
Registered User
 
Join Date: May 2004
Posts: 54
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.
Reply With Quote
  #2 (permalink)  
Old 11-11-09, 09:11
paulzak paulzak is offline
Registered User
 
Join Date: May 2004
Posts: 54
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"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On