View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default How to store the reference of Workbooks in an array.

Hi

Maybe this will help you:

Sub test()
Dim WbArr()
Dim i As Long
ReDim WbArr(Application.Workbooks.Count)
For Each wb In Application.Workbooks
WbArr(i) = wb.Name
i = i + 1
Next
End Sub

Regards,
Per

"Store a reference of a excel workbook"
soft.com skrev i
meddelelsen ...
I have opend four workbooks. Now i wanted to store reference of each
workbook
in an array so that i can use them later. Please see the below code, it is
throwing an error. Here i have opened a workbooks and stored it reference
in
wb, now when i try to store wb in an array, it throws error.

Set arrWorkbooks(i)= wb