?
Solved

excel links

Posted on 2016-11-11
4
Medium Priority
?
62 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 22

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 2000 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 22
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 22
ID: 41908424
solution provided by expert
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
Suggested Courses

762 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