MacroType 属性

       

返回或设置名称所引用的对象。XlXLMMacroType 类型,可读写。

expression.MacroType

expression   必需。该表达式返回“应用于”列表中的对象之一。

示例

本示例假定已在 Microsoft Excel 4.0 宏表上创建了一个自定义函数或自定义命令。本示例显示函数分类,用宏语言表示。假定该自定义函数或自定义命令的名称在指定工作簿中唯一。

With ActiveWorkbook.Names(1)
    If .MacroType <> xlNotXLM Then
        MsgBox "The category for this name is " & .Category
    Else
        MsgBox "This name does not refer to" & _
            " a custom function or command."
    End If
End With