Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Links in VBA

Status
Not open for further replies.

rbuttens

MIS
Jul 22, 2002
4
AU
I was hoping to use vba code to manipulate the links of excel workbooks. Can anyone point me in the right direction.
 
Hi,

You can try the following which changes the link source of your file;

Code:
Sub ChangeLinks()

Dim strFile As String
Dim strNewFile As String

strFile = "C:\File1.xls"
strNewFile = "C:\File2.xls"

With ActiveWorkbook
  .ChangeLink Name:=strFile, NewName:=strNewFile,  Type:=xlExcelLinks
  .UpdateLink Name:=strNewFile, Type:=xlExcelLinks
End with

End Sub

Hope this helps.


Leigh Moore
Solutions 4 MS Office Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top