【发布时间】:2011-01-13 20:15:45
【问题描述】:
在 Excel 2007 中,我在 VBA 中有以下非常简单的代码:
Public Type specType
sb As Long
End Type
Private Sub MyButton_Click()
Dim spec As specType
'...
End Sub
单击按钮时,“Dim spec As specType”行出现“未定义用户定义类型”错误...为什么?我是否必须将我的用户定义类型移动到特殊位置?
【问题讨论】:
-
您必须在模块中声明用户定义的类型。您展示的所有代码是否都放在一个模块中?
标签: vba excel user-defined-types