+ Reply to Thread
Results 1 to 10 of 10

disable all links if workbook1.xls is not open

  1. #1
    Registered User
    Join Date
    12-21-2010
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    83

    Question disable all links if workbook1.xls is not open

    Hi, I have a quick question on update links.

    I have a workbook which reads off another master SS (which opens with it). Sometimes this workbook is used offsite, where the master is not available, a On Error command is used to account for this. However the update links error still appears. I was wondering if there is a way to disable all links.. so if master SS not found disable all links...

    It is not essential as it only takes two click to get rid of the links error, but some of the people i work with have minor heart attacks when they see any Error message in excel, and it takes them 30min to build up the confidence to come and tell me..... very unproductive!

    Thanks for any help

    Code bellow

    Please Login or Register  to view this content.
    Last edited by oo0tommyk0oo; 06-23-2011 at 03:11 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: disable all links if workbook1.xls is not open

    How about this instead:
    Please Login or Register  to view this content.
    No need for nasty error catcher.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    12-21-2010
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: disable all links if workbook1.xls is not open

    Thanks for the reply,

    I tired your code and it still comes up with cannot find S:xxxxxxxxxxxxxxxxx\ MTS-Master.xlsx

    and then the update links error.

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: disable all links if workbook1.xls is not open

    Are you trying to find out if the MTS-Master file is in that location? If so, use the dir function.

  5. #5
    Registered User
    Join Date
    12-21-2010
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: disable all links if workbook1.xls is not open

    No, sorry should have explained it better. Basically if the workbook is opened in the office, the master SS will always be found at that location and should open. However this workbook is often emailed and in that case the master will not be found and should not give an error, as it does not matter that the Master SS is not open off site. I have managed to stop it saying cannot find ..... master.xls but i cannot get it to stop trying to update links.

    Thanks for any help

  6. #6
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: disable all links if workbook1.xls is not open

    Ok, I'm still not sure if I understand, but do you know what the arguments for the Workbook.Open function are? You have UpdateLinks:=1, which tells Excel to try to update the links. If you don't want it to update the links, do UpdateLinks:=0 in your original code.

  7. #7
    Registered User
    Join Date
    12-21-2010
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: disable all links if workbook1.xls is not open

    Ok, so i think i will need a IF command.

    So If Master SS is found and opened UpdateLinks:=1

    If not UpdateLinks:=0

    I will give it a try

    Thanks for the help

  8. #8
    Registered User
    Join Date
    12-21-2010
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: disable all links if workbook1.xls is not open

    Please Login or Register  to view this content.
    This was the best i could do but am getting an error now on ThisWorkbook.Activate , UpdateLinks:=0

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: disable all links if workbook1.xls is not open

    Change the properties of the workbook so it won't be updated automatically

    Please Login or Register  to view this content.
    When opening the workbook you can decide to update or not with:
    Please Login or Register  to view this content.
    Last edited by snb; 06-23-2011 at 03:41 AM.



  10. #10
    Registered User
    Join Date
    12-21-2010
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: disable all links if workbook1.xls is not open

    Thank you so much, works great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1