How to suppress Update Links warning?

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

    Hope to give some extra input in solving this question (or part of it).

    This will work for opening an Excel file from another. A line of code from Mr. Peter L., for the change, use the following:

    Application.Workbooks.Open Filename:="C:\Book1withLinkToBook2.xlsx", UpdateLinks:=3
    

    This is in MSDS. The effect is that it just updates everything (yes, everything) with no warning. This can also be checked if you record a macro.

    In MSDS, it refers this to MS EXCEL 2010 and 2013. I'm thinking that MS EXCEL 2016 has this covered as well.

    I have MS EXCEL 2013, and have a situation pretty much the same as this topic. So I have a file (call it A) with Workbook_Open event code that always get's stuck on the update links prompt. I have another file (call it B) connected to this one, and Pivot Tables force me to open the file A so that the data model can be loaded. Since I want to open the A file silently in the background, I just use the line that I wrote above, with a Windows("A.xlsx").visible = false, and, apart from a bigger loading time, I open the A file from the B file with no problems or warnings, and fully updated.

提交回复
热议问题