Updating Links

  • Is there any way when opening a workbook to not update links. I know of the 'asktoupdatelinks' method but that will update the links automatically.

    Is there any way of not showing the message to update links and then NOT update them upon opening??



  • Open your file.
    Hit Alt+F11.
    Double-click ThisWorkbook at the upper-left panel.
    Paste the following code in there:

    Private Sub Workbook_Open()
    Application.AskToUpdateLinks = False
    End Sub

    Of course, if you have your macro security set to medium, you will be prompted to enable macros, which defeats your purpose, I think.

    Depends on the version of Excel...

  • Note:

    The asktoupdatelilnks method doesnt work on the workook open event becaseu the update links dialog box is loaded before the workbook open event.

    Furthermore, using this will automatically update links, and I want to NOT update the links.

    The problem I am having is that some links are to files in restricted directories on our network, so updating links will bring up the 'locate' links dialog (which I don't want). I can then develop code based on the username to update links the non-restricted files.

    Any thoughts??

  • I knew that, sleeper. I was just testing ya.

    Actually, I had been trying something else, and someone said "this works" and I forgot what ya said. Strange thing too. I found the same answer somewhere else and they said "thanks, it worked". D'oh!

  • Okay. Here's what Bob Umlas said once...

    Create a file with a workbook open that has this in it:

    Sub Auto_Open()
    Workbooks.Open ThisWorkbook.Path & "\YourRealFile.XLS", UpdateLinks:=0
    ThisWorkbook.Close False
    End Sub

    That way, this opens the don't-update-the-darn-links-dammit workbook. :)

    Hope it helps!

  • Hi the_sleeper

    Just too add to tuggies solution, which I believe is about the only way. Place this code in your Workbook with the links.

    Sub Workbook_Open()
    Workbooks.Open ThisWorkbook.Path & "Dummy.XLS"
    ThisWorkbook.Close False
    End Sub

    Make Dummy.xls a hidden Workbook (Window>Hide) and place in the original code:

    Sub Workbook_Open()
    Workbooks.Open ThisWorkbook.Path & "YourRealFile.XLS", UpdateLinks:=0
    ThisWorkbook.Close False
    End Sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!