C
Chris Watts
I am trying to discover the names of the Workbooks and Worksheets that are
open (not active) in Excel, using vba.
When I try:
Sub DiscoverOpenSheets()
Dim wbBook As Workbook
Dim wsSheet As Worksheet
For Each wbBook In Application
MsgBox wbBook.Name
Next
For Each wsSheet In ActiveWorkbook
MsgBox wsSheet.Name
Next
End Sub
Each of the "For Each .. In .." statements causes an error - "Object does
not support this property or method".
What am I doing wron?
TIA
Chris
open (not active) in Excel, using vba.
When I try:
Sub DiscoverOpenSheets()
Dim wbBook As Workbook
Dim wsSheet As Worksheet
For Each wbBook In Application
MsgBox wbBook.Name
Next
For Each wsSheet In ActiveWorkbook
MsgBox wsSheet.Name
Next
End Sub
Each of the "For Each .. In .." statements causes an error - "Object does
not support this property or method".
What am I doing wron?
TIA
Chris