How to suppress Update Links warning?

前端 未结 7 1744
有刺的猬
有刺的猬 2020-11-29 16:51

I\'m trying to write a script that opens many Excel files. I keep getting the prompt:

This workbook contains links to other data sources.

7条回答
  •  日久生厌
    2020-11-29 17:14

    I wanted to suppress the prompt that asks if you wish to update links to another workbook when my workbook is manually opened in Excel (as opposed to opening it programmatically via VBA). I tried including: Application.AskToUpdateLinks = False as the first line in my Auto_Open() macro but that didn't work. I discovered however that if you put it instead in the Workbook_Open() function in the ThisWorkbook module, it works brilliantly - the dialog is suppressed but the update still occurs silently in the background.

     Private Sub Workbook_Open()
        ' Suppress dialog & update automatically without asking
        Application.AskToUpdateLinks = False
    End Sub
    

提交回复
热议问题