Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to detect if a workbook is hidden through VBA
Hello all:
I recently created code that lists all open files in Excel (.xls or otherwise) and then moves the ActiveSheet for each open file to after the active sheet in the active workbook. In addition, all of my code is kept in a separate workbook which is hidden and loads on startup of Excel (so I can access the code on any other open workbook). The move process works great unless a hidden workbook is loaded in Excel (i.e. my code workbook). When the code encounters the hidden workbook it halts after attempting the move and my code workbook is closed automatically. I need to identify which open workbooks are hidden so I can skip them in the move. Lots of help exists regarding hidden worksheets but not workbooks and the VBA object browser does list a hidden property of a workbook. Any suggestions? Thanks, Aaron |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to detect if a workbook is hidden through VBA
Aaron,
Try testing the window visible property windows("myWorkbook.xls").Visible -- HTH RP (remove nothere from the email address if mailing direct) "Aaron" wrote in message ... Hello all: I recently created code that lists all open files in Excel (.xls or otherwise) and then moves the ActiveSheet for each open file to after the active sheet in the active workbook. In addition, all of my code is kept in a separate workbook which is hidden and loads on startup of Excel (so I can access the code on any other open workbook). The move process works great unless a hidden workbook is loaded in Excel (i.e. my code workbook). When the code encounters the hidden workbook it halts after attempting the move and my code workbook is closed automatically. I need to identify which open workbooks are hidden so I can skip them in the move. Lots of help exists regarding hidden worksheets but not workbooks and the VBA object browser does list a hidden property of a workbook. Any suggestions? Thanks, Aaron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to detect if a workbook is hidden through VBA
Thanks Bob! I had tried testing "workbooks.visible" (which of course doesn't
exist) and testing the window did. Thanks again, Aaron "Bob Phillips" wrote in message ... Aaron, Try testing the window visible property windows("myWorkbook.xls").Visible -- HTH RP (remove nothere from the email address if mailing direct) "Aaron" wrote in message ... Hello all: I recently created code that lists all open files in Excel (.xls or otherwise) and then moves the ActiveSheet for each open file to after the active sheet in the active workbook. In addition, all of my code is kept in a separate workbook which is hidden and loads on startup of Excel (so I can access the code on any other open workbook). The move process works great unless a hidden workbook is loaded in Excel (i.e. my code workbook). When the code encounters the hidden workbook it halts after attempting the move and my code workbook is closed automatically. I need to identify which open workbooks are hidden so I can skip them in the move. Lots of help exists regarding hidden worksheets but not workbooks and the VBA object browser does list a hidden property of a workbook. Any suggestions? Thanks, Aaron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I detect hidden worksheets or hidden data on a worksheet? | Excel Discussion (Misc queries) | |||
How to detect if sheet is hidden? | Excel Worksheet Functions | |||
Detect Workbook Name when using GetOpenFileName | Excel Programming | |||
How to hide a workbook and to detect a hidden workbook in visual basic | Excel Programming | |||
Detect more info when workbook does not ack right. | Excel Programming |