Results 1 to 6 of 6

Thread: Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

  1. #1
    Board Regular
    Join Date
    Apr 2005
    Location
    Ontario, Canada
    Posts
    2,869
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

    With this code ....

    Code:
            Dim wba_name As Workbook
            Dim tCol As String
            
            wba_name = "WS " & format(ws_vh.Range("B17"), "dd-mmm-yy") & ".xlsx"
            If Dir(path_name & wba_name) <> "" Then '.tglb_wpl_crtt.BackColor = RGB(0,153,211)
                Workbooks.Open (path_name & wb_name)
                Set wb_name = Workbooks(wba_name)
         ...
    When it reaches the line in red, Excel displays dialogue
    "This workbook contains links to other data sources."

    Question ... considering the code, would this be normal behaviour or is there an error with the code? Just wondering if I need to worry about it.
    I've searched both documents for external links (Find links (external references) in a workbook - Excel) but nothing was found. I don't really know what links are being found to be updated.

    If there is no need to be concerned, is there a way I can block this message from interfering with the flow of my application? Will displayalerts suspend this message?
    Last edited by Ark68; Aug 13th, 2017 at 08:01 AM.

  2. #2
    Moderator mole999's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    8,128
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

    try >
    Application.DisplayAlerts = False

    just after Dim tCol As String
    • Yes I know there are better ways to do it. I just wish I knew them. - 2003, 2007, 2010, 2013 & 2016
    • I wear my ignorance openly, excel is not my chosen career, its a means to an ends
    • Posting Guidelines Want to post well laid out questions and answers Translate Excel Versions
      Code:
      [CODE ]Put Your Code[/ CODE]
    • Settings > General Settings (on the left) scroll to the bottom, > Miscellaneous Options > Use ENHANCED
    • X-Posting Guidelines Rule 13 > CHART STUFF

  3. #3
    Board Regular
    Join Date
    Apr 2005
    Location
    Ontario, Canada
    Posts
    2,869
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

    Thank you Mole for taking a moment to suggest a solution.

    I applied your idea, but the dialogue is still appearing.

    Code:
    Dim wb_name As Workbook
            Dim tCol As String
            
            Application.DisplayAlerts = False 
            
            ws_name = "WS " & format(ws_vh.Range("B17"), "dd-mmm-yy") & ".xlsx"
            If Dir(path_name & ws_name) <> "" Then '.tglb_wpl_crtt.BackColor = RGB(0,153,211)
                
                Workbooks.Open (path_name & ws_name)  ' <--- "This workbook contains links to other data sources."
                Set wb_name = Workbooks(ws_name)

  4. #4
    Board Regular Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    1,051
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

    try
    Code:
    Workbooks.Open Filename:=path_name & ws_name, UpdateLinks:=False
    - Posting guidelines, forum rules and terms of use
    - Try searching for your answer first, see how
    - Read the FAQs
    - List of BB codes

    Running Office 2003 on Win 7

  5. #5
    Board Regular
    Join Date
    Apr 2005
    Location
    Ontario, Canada
    Posts
    2,869
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

    Thank you Fluff! That worked.

  6. #6
    Board Regular Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    1,051
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Application breaks with "...contains links to other data sources" when code opens workbook. No links can be found.

    Glad to help & thanks for the feedback
    - Posting guidelines, forum rules and terms of use
    - Try searching for your answer first, see how
    - Read the FAQs
    - List of BB codes

    Running Office 2003 on Win 7

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.
     


DMCA.com