VBA: 如何将 Variant 变量设置为空?

7

我有以下变量:

Dim comboitems() As Variant

我在代码中使用一个数组作为ComboBox控件的值的容器。

在代码的某个特定点,我需要清空/清除/置空comboitems()。我该如何做?我尝试了以下所有选项,但都没有成功。

comboitems = ""
comboitems = Null
comboitems = Nothing
Set comboitems = ""
Set comboitems = Null
Set comboitems = Nothing
comboitems() = ""
comboitems() = Null
comboitems() = Nothing
Set comboitems() = ""
Set comboitems() = Null
Set comboitems() = Nothing

我收到的错误信息是这样的: enter image description here

2
删除组合项? - Kostas K.
1
不带“preserve”的ReDim - LocEngineer
1个回答

6

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接