VBA to skip warning message

Yulyo

Board Regular
Joined
Jul 17, 2017
Messages
86
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,348
See to use
Code:
Application.EnableEvents = False

and do not forget to re install the alert

Code:
Application.EnableEvents = True
 
Last edited:

Yulyo

Board Regular
Joined
Jul 17, 2017
Messages
86
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:

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
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.
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,348
Application.EnableEvents does not suppress warning messages,

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

Forum statistics

Threads
1,136,203
Messages
5,674,392
Members
419,506
Latest member
mpazr001

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
Top