View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Programmatically opening workbooks in macros brings up Enable

I don't think you are following me. The dialog box never appeared on
Workbook Open until yesterday and I've been running it this way for over a
year with the security setting at medium.

Barb Reinhardt



"Charlie" wrote:

So, did you go to Tools -- Options -- Security and check your security
level? Set it to Low to get rid of the dialog box.

"Barb Reinhardt" wrote:

This is a macro that only I run, and when I change an Application setting
(screenupdating, displayalerts, etc) at the beginning of execution, I
generally change it back at the end. This is something that just started
this week after months of the code working fine. It's most strange.

Barb Reinhardt



"Charlie" wrote:

Make sure you have no Excel sessions open (close them all.) Then start
Excel, go to

Tools -- Macros -- Security ...

and set the security level to "Low", then Exit Excel. Now whenever you open
a workbook that has macros you will not get the warning message. Just be
sure to only open workbooks you trust.

That setting is an "Application Setting" not a "Workbook Setting." In other
words, YOUR version of Excel will not ask you to enable macros but other
users may get the warning, depending on the state of their application
settings. Sending them your workbook after you change an application setting
will NOT change their application settings. Application settings are not
kept in workbooks; they are stored on your box for the benefit of your copy
of Excel.

At our office they have instituted startup scripts that run at bootup (and
sometimes at various times who-knows-when) that set that nasty flag to
"Medium." I'm in and out of my own workbooks all day long so of course I
trust them! What I do is almost never turn off my computer and I almost
always have a copy of one or another workbook open, so if their nasty script
runs when my back is turned, whenever I close a workbook the current state is
saved over whatever they try to set it to!

Regards,
Charlie


"Barb Reinhardt" wrote:

I've been programmatically opening workbooks using Excel 2003 using the
following statement

Set oWB = Workbooks.Open(oldPath, UpdateLinks:=False, ReadOnly:=True)

Today, for the first time, every time a workbook is opened, I get the "Do
you want to enable macros" question. To make it even more complicated, our
organization is just starting to deploy office 2007, so I'm not sure if any
of these workbooks have been edited using 2007.

I'm thinking that using Application.DisplayAlerts = FALSE before the open
statement should resolve my problem, but I'm wondering why it started now.
These workbooks have had macros for over a year.

Any ideas?

Thanks,
Barb Reinhardt