DisplayAlerts (Which Ones?)

G

Guest

Notice in the code below, I am setting DisplayAlerts = False; however, on
opening the file (from Access) I still get a message that warns of extranal
links and asks if I want to update them? I don't, and I don't want my users
do so or it will corrupt data. I have not found a definitive discussion of
which alerts are not displayed and which are. Perhaps there is another way
to handle this. Assistance will be appreciated.

Set xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Interactive = False
Set xlBook = xlApp.Workbooks.Open(varGetFileName)
(message occurs upon execution of the above line)
 
J

Jake Marx

Hi Klatuu,
Notice in the code below, I am setting DisplayAlerts = False;
however, on opening the file (from Access) I still get a message that
warns of extranal links and asks if I want to update them? I don't,
and I don't want my users do so or it will corrupt data. I have not
found a definitive discussion of which alerts are not displayed and
which are. Perhaps there is another way to handle this. Assistance
will be appreciated.

Set xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Interactive = False
Set xlBook = xlApp.Workbooks.Open(varGetFileName)
(message occurs upon execution of the above line)

The second argument to the Open method is UpdateLinks. If you set this to
0, links will not be updated, and your users should not get prompted to
update links:

Set xlBook = xlApp.Workbooks.Open(varGetFileName, 0)

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
G

Guest

That did it, thanks Jake.

Jake Marx said:
Hi Klatuu,
Notice in the code below, I am setting DisplayAlerts = False;
however, on opening the file (from Access) I still get a message that
warns of extranal links and asks if I want to update them? I don't,
and I don't want my users do so or it will corrupt data. I have not
found a definitive discussion of which alerts are not displayed and
which are. Perhaps there is another way to handle this. Assistance
will be appreciated.

Set xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Interactive = False
Set xlBook = xlApp.Workbooks.Open(varGetFileName)
(message occurs upon execution of the above line)

The second argument to the Open method is UpdateLinks. If you set this to
0, links will not be updated, and your users should not get prompted to
update links:

Set xlBook = xlApp.Workbooks.Open(varGetFileName, 0)

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top