我正在运行 Excel 2003。我有以下 VBA 代码,对应于一个由控件和控件UserForm
组成的简单代码。它通过保存工作,但在保存时会产生类型不匹配错误。ComboBox
Label
ComboBox
Label
Private whatComboBox As ComboBox
Private whatLabel As Label
Private Sub UserForm_Initialize()
Call SaveComboBox(SomeComboBox)
Call SaveLabel(SomeLabel)
End Sub
Private Sub SaveComboBox(aComboBox As ComboBox)
Set whatComboBox = aComboBox
End Sub
Private Sub SaveLabel(aLabel As Label)
Set whatLabel = aLabel
End Sub
[而且我很欣赏 VBA 与大多数其他语言相比是有限的。但我不会想到这是会出错的那种事情。]
谢谢大家!