Sub test()
Dim wlink As Variant
Dim i As Long
Dim ck As Boolean
Dim tmp As String
Dim msg As String
With Worksheets(\u0026quot;Sheet1\u0026quot;)
Application.DisplayAlerts = False
wlink = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
If IsEmpty(wlink) Then
MsgBox \u0026quot;このブックにリンクはありません\u0026quot;
Exit Sub
End If
On Error Resume Next
For i = LBound(wlink) To UBound(wlink)
Err.Clear
ActiveWorkbook.UpdateLink Name:=wlink(i)
If Err.Number \u0026lt;\u0026gt; 0 Then
tmp = \u0026quot;Err.Number=\u0026quot; \u0026amp; Err.Number \u0026amp; \u0026quot; : \u0026quot; \u0026amp; wlink(i)
tmp = Mid(tmp, .Range(\u0026quot;B1\u0026quot;).Value, .Range(\u0026quot;B2\u0026quot;).Value)
msg = msg \u0026amp; tmp \u0026amp; vbCrLf
ck = True
End If
Next i
If ck = False Then
.Range(\u0026quot;A1\u0026quot;).Value = \u0026quot;OK\u0026quot;
Else
.Range(\u0026quot;A1\u0026quot;).Value = \u0026quot;NG\u0026quot;
MsgBox msg
End If
Exit Sub
Application.DisplayAlerts = True
End With
End Sub