17.Array already dimensioned数组已指定维度 18.Array argument must be ByRef数组参数必须是 ByRef 19.Assignment to constant not permitted不允许分配给常数 20.Automation error (Error 440)自动化错误(错误 440) 21.Automation object doesn't
ReDim Preserve vRet(UBound(vArray) + 1) vRet(UBound(vRet)) = vElem End If AddElement = vRet End Function Public Function IsDimensioned(ByRef TheArray) As Boolean If IsArray(TheArray) Then ' we need to test it! otherwise will return false if not an array! ' If you put extensive use...
Whereas the collection has 3 items, the array only needs to be dimensioned to 2 because there is an element 0 Sub ConvertCollectionToArray() Dim MyCollection As New Collection Dim MyArray(2) As String MyCollection.Add "Item1" MyCollection.Add "Item2" MyCollection.Add "Item3" For n = ...