任何人都可以向我解释为什么会这样:
Dim myArr As Variant `or, myArr()`
myArr = Array("Brian", "Steve", "Dan", "Mark", "Tom")
这并不是:
Dim myArr As String
myArr = Array("Brian", "Steve", "Dan", "Mark", "Tom")
我收到运行时错误' 13':类型不匹配
答案 0 :(得分:2)
这是因为函数Array
返回Variant
:
https://msdn.microsoft.com/en-us/library/aa262675(v=vs.60).aspx