Counting hidden workbooks

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
I have a macro in a shared workbook that is run by a number of people at different times. Some of the users have hidden workboooks (eg I have "personal" hidden) whilst other dont.

What is the syntax to count the number of hidden workbooks?

(eg something like activeworkbooks.hidden.count?????)
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
tactps said:
I have a macro in a shared workbook that is run by a number of people at different times. Some of the users have hidden workboooks (eg I have "personal" hidden) whilst other dont.

What is the syntax to count the number of hidden workbooks?

(eg something like activeworkbooks.hidden.count?????)
Hi!
Did you mean hidden workbooks or hidden worksheets?
 
Upvote 0
Hidden workbooks.

For example, I have "personal.xls" in my xlstart menu, but I have hidden it so that Book1 will be visible when I open Excel.

However, other users do not have hidden workbooks, so I would like to count the number of hidden workbooks to adjust the number in my macro.
 
Upvote 0
Your'll have to loop through the Windows objects and test if hidden (visible) or not eg

Code:
Sub Tester()
Dim x As Integer
Dim Wb As Window

For Each Wb In Windows
    If Wb.Visible <> True Then
        x = x + 1
    End If
Next

MsgBox x & " hidden Window(s)"

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,401
Members
448,893
Latest member
AtariBaby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top