Consulting

Results 1 to 7 of 7

Thread: Stop dialog box popping up

  1. #1

    Stop dialog box popping up

    Dear all, I have an excel file which has a link to a word. Whenever I open this excel file, at the point of opening, a dialog box pops-up saying, "this workbook contains links to other data sources.......update? dont update? help" I would like to stop this dialog box popping up. Is there any VBA code which can be placed with the workbook_open event to stop that?

    Thanks,

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    What do you want to do with the links? always update, never update or ask to update?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    I want "never update"

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Add this to the ThisWorkbook code module:
    [vba]Private Sub Workbook_Open()
    Me.UpdateLinks = xlUpdateLinksNever
    End Sub[/vba]

    How to Save a Workbook Event Macro
    1. Copy the macro above
    2. Open your Workbook and press ALT+F11 keys to open the Visual Basic Editor.
    3. Press CTRL+R keys to shift the focus to the Project Explorer Window
    4. Press the Down Arrow Key until ThisWorkbook is highlighted in blue.
    5. Press the Enter key to move the cursor to the Code Window
    6. Paste the macro code using CTRL+V
    7. Save the macro in your Workbook using CTRL+S
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  5. #5
    Thanks Simon for your reply. However your code was generating an error, so I changed it to:

    Private Sub ThisWorkbook_Open()
    Me.UpdateLinks = xlUpdateLinksNever
    End Sub

    However above code could not stop popping up that dialog box. I am using office-2010. Is there any better idea?

    Thanks,

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Simon's code works for me in 2010. Check you have it in ThisWorkbook module.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Quote Originally Posted by arrun
    Thanks Simon for your reply. However your code was generating an error, so I changed it to:

    Private Sub ThisWorkbook_Open()
    Me.UpdateLinks = xlUpdateLinksNever
    End Sub

    However above code could not stop popping up that dialog box. I am using office-2010. Is there any better idea?

    Thanks,
    The code i supplied works for me in xl2003, xl2007 & xl2010, as MD said did you folllow my instructions on adding it to the ThisWorkbook code module?, just adding ThisWorkbook to OPEN won't make any difference to the problem it simply stops the code being workbook event code.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •