How to Stop the Update Dialog from Appearing?

H

hce

Dear All

I have a macro A that opens a specified file and then run another macr
which is macro B when the file is opened. After the macro has finished
the file will save and close.

Everything is working fine. My only issue is that because the file ha
links... hence when Macro A opens the file, a dialog box will pop ou
and ask whether i want to update the links or not...

I do not want to update the links... this is very irritating becaus
the macro's supposed to do everything without my input but because o
this update dialog box, i must be at the computer to wait for the macr
to finish... as I would need to click do not update each time a file i
opened if not the macro will just pause and wait...

Hence, my question is.. is there a way I can also automate thi
clicking of the update dialog box...? if yes, how can i do it...?
will really appreciate any suggestions...

Cheer
 
H

hce

in addition, I know I can disable the alert in excel... but I would lik
to have the update alert on so that it can update the link
automatically if there's a need.... so it would be glad if someone ca
come up with a vba code that will help me to click "YES" or "NO" to th
update dialog...

cheers.
 
H

Hans

Does it help if you put the following code at the
beginning of your macro:

Application.EnableEvents = False
and
Application.EnableEvents = True
at the end?

regards
Hans
 
J

Jim Rech

The second argument of the Workbooks.Open method is "update links". If you
set it to False your problem should go away.

Workbooks.Open "book1.xls", False

--
Jim Rech
Excel MVP
| Dear All
|
| I have a macro A that opens a specified file and then run another macro
| which is macro B when the file is opened. After the macro has finished,
| the file will save and close.
|
| Everything is working fine. My only issue is that because the file has
| links... hence when Macro A opens the file, a dialog box will pop out
| and ask whether i want to update the links or not...
|
| I do not want to update the links... this is very irritating because
| the macro's supposed to do everything without my input but because of
| this update dialog box, i must be at the computer to wait for the macro
| to finish... as I would need to click do not update each time a file is
| opened if not the macro will just pause and wait...
|
| Hence, my question is.. is there a way I can also automate this
| clicking of the update dialog box...? if yes, how can i do it...? i
| will really appreciate any suggestions...
|
| Cheers
|
|
| ---
|
|
 
Top