Solved

excel links

Posted on 2016-11-11
4
59 Views
Last Modified: 2016-12-01
Hi,

is there any way to update the links in all excel links?

we have new DFS set up and most of the excel sheets have hard links that needs to updated with updated DFS path.

does Excel sheet needs to opened to update links?

I'm looking for a quick and easy solution please if any exists

thanks
0
Comment
Question by:kuzum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 21

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 500 total points (awarded by participants)
ID: 41884431
here is a macro you can run to change links.  You will be prompted with the path and filename of each link. You can edit it, paste a new value, or skip it.
Sub ChangeWorkbookLinks()
'161111 strive4peace

   Dim vLinks As Variant
   Dim i As Integer
   Dim sNewLink As String
   
   vLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
   If Not IsEmpty(vLinks) Then
      For i = LBound(vLinks) To UBound(vLinks)
         sNewLink = InputBox("Enter new path\file for link", "Change Link", vLinks(i))
         If sNewLink <> "" And sNewLink <> vLinks(i) Then
            ActiveWorkbook.ChangeLink vLinks(i), sNewLink
         End If
      Next i
   End If
End Sub

Open in new window

0
 

Author Comment

by:kuzum
ID: 41884466
thanks for this.

do I need to use this for each excel and each excel needs to be opened?  OR you run this in one excel against all excel sheets in the directory?

regards
0
 
LVL 21
ID: 41884587
you're welcome
This code would run on each workbook. To make it easier, put it in your personal macro workbook so you can run it whenever you want and on whatever workbook is active.
0
 
LVL 21
ID: 41908424
solution provided by expert
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question