返回或设置名称所引用的对象。XlXLMMacroType 类型,可读写。
XlXLMMacroType 可为以下 XlXLMMacroType 常量之一。 |
xlCommand 引用一个用户定义宏的名称。 |
xlFunction 引用一个用户定义函数的名称。 |
xlNotXLM 此名称不引用函数或宏。 |
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