Share via


WorkbookBase.UpdateLink 메서드

Microsoft Office Excel, DDE 또는 OLE 링크를 업데이트합니다.

네임스페이스:  Microsoft.Office.Tools.Excel
어셈블리:  Microsoft.Office.Tools.Excel.v4.0.Utilities(Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

구문

‘선언
Public Sub UpdateLink ( _
    name As Object, _
    type As Object _
)
public void UpdateLink(
    Object name,
    Object type
)

매개 변수

  • name
    형식: System.Object
    LinkSources 메서드에서 반환된 Excel 또는 DDE/OLE 링크 중 업데이트할 링크의 이름입니다.

설명

이 메서드를 매개 변수 없이 호출하면 Excel에서 기본적으로 모든 워크시트 링크가 업데이트됩니다.

선택적 매개 변수

선택적 매개 변수에 대한 자세한 내용은 Office 솔루션의 선택적 매개 변수를 참조하십시오.

예제

다음 코드 예제에서는 Excel 통합 문서에 대한 외부 링크를 만든 다음 UpdateLink 메서드를 사용하여 링크를 업데이트합니다. 이 예제에서는 통합 문서 Book2.xls가 C 디렉터리의 루트에 있다고 가정합니다.

Private Sub WorkbookUpdateLink()
    Dim Links As Array = _
        CType(Me.LinkSources(Excel.XlLink.xlExcelLinks),  _
        Array)
    If Links IsNot Nothing Then
        Dim i As Integer
        For i = 1 To Links.Length
            Me.UpdateLink(Links(i), _
                Excel.XlLinkType.xlLinkTypeExcelLinks)
        Next i
    Else
        MsgBox("The workbook contains no links to " & _
            "other workbooks.")
    End If
End Sub
private void WorkbookUpdateLink()
{
    Array links = (Array)this.LinkSources(Excel.XlLink.xlExcelLinks);

    if (links != null)
    {
        for (int i = 1; i <= links.Length; i++)
        {
            this.UpdateLink((string)links.GetValue(i),
                Excel.XlLinkType.xlLinkTypeExcelLinks);
        }
    }
    else
    {
        MessageBox.Show("The workbook contains no links to " +
            "other workbooks.");
    }
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

WorkbookBase 클래스

Microsoft.Office.Tools.Excel 네임스페이스