Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Alerts VBA

Tags:

excel

vba

I have a macro that has the in the top line (after dimming my variables) the two lines

Application.EnableEvents = False
Application.DisplayAlerts = False

my issue is that despite having these during my macro I still get a pop-up asking me if I want to update links or not. Does anyone know why this may be happening / a way to fix it?

Thank you very much (I didn´t include my code because the reason the update links thing pop up is due to the documents I'm opening and not the code itself)

like image 628
Sean Connecticut Avatar asked Dec 09 '22 14:12

Sean Connecticut


2 Answers

If you want to apply this at the vba level any time during the execution of the code you can either apply the restriction at workbook level or at application level like so

WorkbookName.UpdateLinks = xlUpdateLinksNever
AppExcel.AskToUpdateLinks = False
like image 163
Andre Pageot Avatar answered Dec 26 '22 02:12

Andre Pageot


When you open workbooks, be sure to include UpdateLinks = false in the parameters.

http://msdn.microsoft.com/en-us/library/office/ff194819.aspx

Specifies the way external references (links) in the file, such as the reference to a range in the Budget.xls workbook in the following formula =SUM([Budget.xls]Annual!C10:C25), are updated. If this argument is omitted, the user is prompted to specify how links will be updated.

(Emphasis mine)

like image 29
ApplePie Avatar answered Dec 26 '22 01:12

ApplePie