我有以下代码,但我不知道为什么 ExcelEnum
在子例程中看不到类型(我已声明)Test2()
:
Private Sub Test1()
Dim test_name As Variant
End Sub
Private Enum rlcRollercoasterState
rlcRollercoasterDisabled
rlcRollercoasterEnabled
rlcRollercoasterBroken
rlcRollercoasterMissing
End Enum
Private Sub Test2()
Dim var1 As Variant
Dim rlcRC1State As rlcRollercoasterState ' User-defined type not defined
End Sub
如果我在类型声明之后复制Test1()
子例程Enum
,Excel 会识别. 如果我注释掉子例程,Excel 会识别输入.rlcRollercoasterState
Test1()
Test1()
rlcRollercoasterState
Test2()
为什么 Excel 看不到子程序rlcRollercoasterState
中的类型?Test2()