+ Reply to Thread
Results 1 to 1 of 1

ChangeLink locks up Excel completely

  1. #1
    Registered User
    Join Date
    10-16-2020
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    4

    Question ChangeLink locks up Excel completely

    With reference to this old thread: https://www.excelforum.com/excel-pro...ink-error.html

    We have a complex Spreadsheet with external links to Data in other spreadsheets, so has 4 file links.

    We have been using this call for several years to change the links to different files on the local C: Drive after checking they exist
    ThisWorkbook.ChangeLink OldLink, NewLink

    Now randomly it seems, Excel sometimes gets completely stuck at this call.

    I currently have Microsoft 365 MSO (version 2401 Build 16.0.17231.20084) 64-bit, running on Windows 10.

    The symptoms (strangely it does not happen every time performing the same actions with the same linked files!) are that when our code calls ThisWorkbook.ChangeLink:

    Excel is completely stuck and cannot even be killed by Task Manager. The only way to continue is to restart Windows!

    At this point another Excel window is opened showing the Home screen where you can select a New "Blank workbook", etc. You can close the additional Excel. BUT it is the original Excel window that is completely stuck!

    Also "Svchost . exe (DcomLaunch -p)" is stuck taking about 27% of my CPU (which has 14 Physical and 20 Logical Cores), with this detail shown in Task Manager:

    Service Host: DCOM Server Process Launcher (5)

    System Events Broker
    Power
    Plug and Play
    DCOM Server Process Launcher
    Background Tasks and Infrastructure Service

    The "Services and Controller App" is taking ~9% and Excel about ~6%!

    A Thread "ChangeLink error" on this Forum from a while ago had a solution to the same issue proposed in Post #10 (from 17th Nov 2020 by carlosrgns) saying Excel goes wrong "If the link is not referenced in the active sheet".

    But I do not understand what was meant! - Referring to that post and the code included in it:

    Does it mean that you need to make sure that at least one cell in each Worksheet references each external Link?

    If I understand the code correctly, it opens the new linked file, then finds the old link and sets up a loop through all the Worksheets in the Workbook.

    However, as soon as it manages to activate the Worksheet and then activate the Workbook and call ChangeLink and set UpdateXlsLinkSource to True, with Err = 0, it will exit the SHEET loop!

    So I do not see how that prevents ChangeLink from hanging Excel and also Err will surely always be 0 from the "UpdateXlsLinkSource = True" line before it is tested????

    Any clarification or pointers anyone can give on this will be much appreciated.

    FYI
    One of my colleagues thought the issue might be being caused by UDFs (recently added) using Named Ranges internally, rather than being passed all values they need to work. However, I think I have eliminated this as a possible cause.

    He has said: "Unhandled errors in UDFs are ignored (the do not trigger run-time errors) and may cause Excel to get confused about the chain of calculations it needs to do.".

    He has also seen Run time Error 10 "This array is fixed or temporarily locked" which he thinks also might be related to UDFs and/or RedDim statements!?! - However "Debug" then highlights a line which is 2 call stack levels above a call to ChangeLink with no ReDim statements anywhere in that code!?! - All very confusing.

    Thanks
    Henry
    Last edited by AliGW; 01-31-2024 at 05:55 AM. Reason: Link added (for a second time - please do not remove).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel locks up
    By aresquare1 in forum Excel General
    Replies: 7
    Last Post: 04-16-2021, 09:18 AM
  2. Accessing Add-In locks Excel
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2016, 02:27 PM
  3. Save as locks up Excel
    By Greg Q in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 02:40 PM
  4. help! printing locks up excel
    By pywhacket in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-24-2006, 12:45 PM
  5. [SOLVED] Excel Locks Up
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 02-13-2006, 04:45 PM
  6. Excel Locks up at end of Sub
    By Hugenstein in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2005, 09:54 AM
  7. [SOLVED] pcanywhere locks up excel
    By ccart123 in forum Excel General
    Replies: 0
    Last Post: 08-23-2005, 04:05 PM

Tags for this Thread

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