我遇到以下代码的问题。每当它到达最后一行时,它都会抛出错误“Argument Not Optional”,并且不会编译。我不知道它在谈论什么论点。
Option Base 1
Dim temp As New ProductionItem 'Production Item is a class that I made
Dim Arr() As Collection
ReDim Arr(5)
Dim coll As New Collection
coll.Add temp
Arr(1) = coll
答案 0 :(得分:1)
只需要设置
Option Base 1
Sub fun()
Dim Arr() As Collection
ReDim Arr(5)
Dim coll As New Collection
coll.Add 1
Set Arr(1) = coll
End Sub