Linking


Update Values

Update the links in a single workbook

ActiveWorkbook.UpdateLink Name:="C:\Temp\Workbook1.xls", _ 
                          Type:=xlLinkType.xlLinkTypeExcelLinks

Change Source

Change the link folder path

ActiveWorkbook.ChangeLink Name:="C:\Temp\Workbook2.xls", _ 
                          NewName:="C:\Temp\Charts1.xls", _
                          Type:=xlLinkType.xlLinkTypeExcelLinks

Dim iValue As Integer 
Dim arArray As Variant()
arArray = ActiveWorkbook.LinkSources(xlLink.xlOLELinks)
'returns an array of links in the workbook in the format DDE link - Server|Document!Item

For icount = 1 To UBound(arArray)
   iValue = ActiveWorkbook.LinkInfo(arArray(icount),xlLinkInfo.xlUpdateSate, xlLinkInfoType.xlLinkInfoOLELinks)

   If (iValue = 1) Then 'link updates automatically
   If (iValue = 2) Then 'link updates manually
Next icount

xlLinkStatus ??
xlUpdateLinks ??



© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext