ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get ActiveWindow (https://www.excelbanter.com/excel-programming/381955-how-get-activewindow.html)

[email protected][_2_]

How to get ActiveWindow
 
What is the parent of ActiveWindow?

It's not available as ThisWorkbook.ActiveWindow or
Application.ActiveWindow .

Thanks.


Peter T

How to get ActiveWindow
 
I can only describe parentage of Excel's Windows as ambigous!

Assuming there is an active workbook, instead of ActiveWindow try -

Activeworkbook.windows(1)

which should return its expected parent.

Curiosity, why do you need to know its parent.

FWIW
b = ActiveWindow Is Nothing
is one way to determine there are no visible workbooks

Regards,
Peter T


wrote in message
oups.com...
What is the parent of ActiveWindow?

It's not available as ThisWorkbook.ActiveWindow or
Application.ActiveWindow .

Thanks.




Sir Tom

How to get ActiveWindow
 
If your trying to get the Workbook name it would be
ThisWorkBook.Name

or the active worksheet would be

ActiveSheet.Name


" wrote:

What is the parent of ActiveWindow?

It's not available as ThisWorkbook.ActiveWindow or
Application.ActiveWindow .

Thanks.



[email protected][_2_]

How to get ActiveWindow
 
I'm trying to create a FreezePane from VBScript without creating an
Excel Macro and calling that.

Curiosity, why do you need to know its parent.



NickHK

How to get ActiveWindow
 
ActiveWindow.Parent.Name
or
Application.Windows(1).Parent.Name

And to go the other way:
ThisWorkbook.Windows(1).Caption

Note that a WB may have more than 1 window. This is shown by
Thisworkbook.Windows.Count and the .WindowNumber property of each of these
windows.

But I'll certainly agree with Peter that the way WBs and Windows are related
is not always clear.

NickHK

wrote in message
oups.com...
What is the parent of ActiveWindow?

It's not available as ThisWorkbook.ActiveWindow or
Application.ActiveWindow .

Thanks.




Sir Tom

How to get ActiveWindow
 
Might look at this posting "VB code to FreezePane a row in an Excel
spreadsheet".

http://www.experts-exchange.com/Prog..._21165508.html



" wrote:

I'm trying to create a FreezePane from VBScript without creating an
Excel Macro and calling that.

Curiosity, why do you need to know its parent.





All times are GMT +1. The time now is 01:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com