Excel DisplayAlerts Fails on Opening Workbook with GetObject

Viewed 160

I want to use GetObject to open a workbook. I also want to disable alerts to update links during opening. It fails with GetObject:

Application.DisplayAlerts = False
Dim Wb as Workbook
Set Wb = GetObject("C:\MyFile.xlsx")    ' <- update-links alert displayed here

Setting Application.EnableEvents = False before GetObject works as expected (i.e., prevents Workbook_Open in the opened book from running).

How can I disable update-links alert when using GetObject?

I'm using GetObject instead of Workbooks.Open, because GetObject cleanly opens the file as hidden, with barely a flicker on the front-end, which is what I need.

1 Answers

Solved:

Application.AskToUpdateLinks = False

Related