View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
chijanzen chijanzen is offline
external usenet poster
 
Posts: 139
Default Exclude hidden workbooks from list

Duke:

try,

Private Sub UserForm_Initialize()
Dim wbk As Workbook
For Each wbk In Workbooks
If wbk.Windows(1).Visible = True Then
Me.ListBox1.AddItem wbk.Name
End If
Next
End Sub

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Duke Carey" wrote:

I'd like to list all open - but NOT hidden - workbooks in a userform listbox.
However, I am unable to find any properties that tell if a book is hidden or
not.

You can try to activate each book and test for success, I suppose, but there
has to be a more elegant way than that. Isn't there?