Auto-open file call from Excel VBA

J

Jon

Background: I'm using a remote piece of software to download a data se
into an excel file that I have ready built. The software can cal
macros prior to, and post downloading.

In one of the pre-called macros, I need to open a file which has links
When it runs though, I need the macro to auto-answer the queries to

1) Enable Macros (YES)
2) Automatically update links (YES)

for every file that is dependent on it.

Anyone know how to force these through please, or just disable Exce
asking?

Much obliged,
Jo
 
D

DNF Karran

You can disable xl asking using "Application.displayalerts= false".

part of the syntax of the open command is whether you want to updat
the links- see the VBE help file for more, though putting this will d
the job.

Workbooks.Open "C:\book.xls", True

If you display alerts the macro option will be suppressed and leave
then enabled on my PC. However, other users with security settings se
higher may default to disabled.

Dunca
 
D

Dave Peterson

Maybe you could change the way those macros open the workbook.

There's an updatelinks parm that you can use to do

dim Wkbk as workbook
set wkbk = workbooks.open(....,updatelinks:=0, ....)

There's a few options for that updatelinks parm. You can read about them in
VBA's help.

The enable macros question is a security feature. Each user can change the
settings the way he/she wants. It's under tools|macro|security (in xl2002).

But it wouldn't be very secure if you could change this anytime/anywhere you
wanted.
 
Top