VBA to skip warning message

Yulyo

Board Regular
Joined
Jul 17, 2017
Messages
94
Hello all,

I have a very simple problem (i am sure it is), but i just can't resolve it:

- I have one excel workbook that opens another workbook with VBA:
Application.Workbooks.Open Filename:="C:\Users\xxx\Desktop\yyy.xlsx", UpdateLinks:=True

-I need the VBA to update all the links, then copy one sheet to a new workbook.
The problem that i have is that, in the middle of the code execution i receive a message:
"We can't update some of the links in your workbook right now"

Usually when i was not using VBA, i used to click on "Continue" button.
Is there any chance i can make VBA do the same thing and continue the remained code execution?

Also, on the new created workbook, i need to break all the existing links. Could you please help me with a code for that?


Thank you
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
See to use
Code:
Application.EnableEvents = False

and do not forget to re install the alert

Code:
Application.EnableEvents = True
 
Last edited:
Upvote 0
Hello PCL
Should my code look like this?

Application.EnableEvents = False
Application.Workbooks.Open Filename:="C:\Users\xxx\Desktop\yyy.xlsx", UpdateLinks:=True
Application.EnableEvents = True

I am asking, because i am still receiving the same message...
 
Last edited:
Upvote 0
Application.EnableEvents does not suppress warning messages, it suppresses event procedure VBA code from automatically running.
Application.DisplayAlerts is the one to use to suppress warning messages.
 
Upvote 0
Application.EnableEvents does not suppress warning messages,

Clear, I selected the bad sample in my notes ...!
 
Upvote 0

Forum statistics

Threads
1,213,565
Messages
6,114,338
Members
448,569
Latest member
Honeymonster123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top