confusion123
Active Member
- Joined
- Jul 27, 2014
- Messages
- 400
For some reason, the following fails with the error message: Object required
Please explain what is wrong.
Thanks
Code:
Sub Test
Dim Mywbs() As Variant
Mywbs = Array("C:\Test\Apples.xlsm", "C:\Test\Oranges.xlsm")
Dim Counter As Integer
For Counter = 0 to 1
Call GetWorkbook(Mywbs(Counter)) ' FAILS HERE
Next Integer
End Sub
Sub GetWorkbook(ByVal Mywbs As Workbook)
Mywbs.Open
End Sub
Please explain what is wrong.
Thanks