VB Code:
Dim Arr(0 To 4) as String, Obj As Object, Stri Arr(0) = "zero" Arr(1) = "one" Arr(2) = "two" Arr(3) = "three" 'looking to make the below sub ArrToObj Arr, Obj For Each Stri In Obj Debug.Print Stri Next
Printable View
VB Code:
Dim Arr(0 To 4) as String, Obj As Object, Stri Arr(0) = "zero" Arr(1) = "one" Arr(2) = "two" Arr(3) = "three" 'looking to make the below sub ArrToObj Arr, Obj For Each Stri In Obj Debug.Print Stri Next
Are you looking something like this?
VB Code:
Dim Arr As Collection Dim MyObject As Object Dim i As Integer Set Arr = New Collection Arr.Add CreateObject("Excel.Application") Arr.Add CreateObject("Word.Application") For i = 1 To Arr.Count Debug.Print Arr.Item(i) Next For Each MyObject In Arr Debug.Print MyObject Next
Works perfectly. Thanks.