XmlMappedRange.FormulaLabel 属性

获取或设置 XmlMappedRange 控件的公式标签类型。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
Property FormulaLabel As XlFormulaLabel
    Get
    Set
XlFormulaLabel FormulaLabel { get; set; }

属性值

类型:Microsoft.Office.Interop.Excel.XlFormulaLabel
XmlMappedRange 控件的公式标签类型。

备注

如果范围不包含标签,或者包含以下 XlFormulaLabel 常数之一,则此属性的返回值可为 xlNone

示例

下面的代码示例使用 FormulaLabel 属性将 XmlMappedRange 设置为列标签。 此代码示例假定当前工作表包含一个名为 CustomerLastNameCell 的 XmlMappedRange

Private Sub ShowFormulaLabel()
    Globals.ThisWorkbook.AcceptLabelsInFormulas = True
    Me.CustomerLastNameCell.FormulaLabel = _
        Excel.XlFormulaLabel.xlColumnLabels
End Sub
private void ShowFormulaLabel()
{
    Globals.ThisWorkbook.AcceptLabelsInFormulas = true;
    this.CustomerLastNameCell.FormulaLabel = 
        Excel.XlFormulaLabel.xlColumnLabels;
}

.NET Framework 安全性

请参见

参考

XmlMappedRange 接口

Microsoft.Office.Tools.Excel 命名空间