Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,081
Default Exclude hidden workbooks from list

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,081
Default Exclude hidden workbooks from list

Much simpler, and very effective. Thanks

"chijanzen" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Exclude hidden workbooks from list

Duke,

For Each WkBk in Workbooks
If WkBk.Windows(1).Visible Then
'- - - -
Next

Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Duke Carey"

wrote in message
...
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?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude Hidden Row Values Dewayne Excel Worksheet Functions 4 January 1st 10 05:22 PM
Copy Worksheet and Exclude Hidden fields Charles Gonzalez Excel Worksheet Functions 3 August 12th 08 12:31 AM
Exclude data from summary totals when hidden XVOTE Excel Worksheet Functions 1 April 13th 06 03:37 PM
Is there a way to exclude hidden rows/columns when printing a doc Jeanette Abbott-Bell Setting up and Configuration of Excel 3 April 5th 06 10:39 PM
Exclude hidden data from summary totals XVOTE Excel Discussion (Misc queries) 2 June 3rd 05 05:26 AM


All times are GMT +1. The time now is 06:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"