How to suppress Update Links warning?

前端 未结 7 1737
有刺的猬
有刺的猬 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:13

    (I don't have enough rep points to add a comment, but I want to add some clarity on the answers here)

    Application.AskToUpdateLinks = False is probably not what you want.

    If set to False, then MS Excel will attempt to update the links automatically it just won't prompt the user beforehand, sorta counter-intuitive.

    The correct solution, if you're looking to open a file without updating links should be:

    Workbook.Open(UpdateLinks:=0)

    Related link: Difference in AskToUpdateLinks=False and UpdateLinks:=0

提交回复
热议问题