Share via


WorkbookBase.UpdateLinks 屬性

命名空間:  Microsoft.Office.Tools.Excel
組件:  Microsoft.Office.Tools.Excel.v4.0.Utilities (在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)

語法

'宣告
Public Property UpdateLinks As XlUpdateLinks
public XlUpdateLinks UpdateLinks { get; set; }

屬性值

型別:Microsoft.Office.Interop.Excel.XlUpdateLinks
其中一個 XlUpdateLinks 值。

範例

下列程式碼範例使用 UpdateLinks 屬性,顯示如何在活頁簿中更新內嵌 OLE 連結。

這是示範文件層級自訂的範例。

Private Sub DisplayLinkUpdateType()
    Select Case Me.UpdateLinks
        Case Excel.XlUpdateLinks.xlUpdateLinksAlways
            MsgBox("Links will always be updated.")
        Case Excel.XlUpdateLinks.xlUpdateLinksNever
            MsgBox("Links will never be updated.")
        Case Excel.XlUpdateLinks.xlUpdateLinksUserSetting
            MsgBox("Links will update according " & _
                "to the user settting.")
    End Select
End Sub
private void DisplayLinkUpdateType()
{
    switch (this.UpdateLinks)
    {
        case Excel.XlUpdateLinks.xlUpdateLinksAlways:
            MessageBox.Show("Links will always be updated.");
            break;
        case Excel.XlUpdateLinks.xlUpdateLinksNever:
            MessageBox.Show("Links will never be updated.");
            break;
        case Excel.XlUpdateLinks.xlUpdateLinksUserSetting:
            MessageBox.Show("Links will update according " +
            "to the user settting.");
            break;
    }
}

.NET Framework 安全性

請參閱

參考

WorkbookBase 類別

Microsoft.Office.Tools.Excel 命名空間