Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2007

Tip: Looking for answers? Try searching our database.

How to get ActiveWindow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gimme_this_gimme_that@yahoo.com - 25 Jan 2007 22:13 GMT
What is the parent of ActiveWindow?

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

Thanks.
Peter T - 25 Jan 2007 22:32 GMT
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

> What is the parent of ActiveWindow?
>
> It's not available as ThisWorkbook.ActiveWindow or
> Application.ActiveWindow .
>
> Thanks.
gimme_this_gimme_that@yahoo.com - 25 Jan 2007 23:51 GMT
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.
Sir Tom - 26 Jan 2007 04:09 GMT
Might look at this posting "VB code to FreezePane a row in an Excel
spreadsheet".

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q
_21165508.html


> 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.
Sir Tom - 25 Jan 2007 22:40 GMT
If your trying to get the Workbook name it would be
ThisWorkBook.Name

or the active worksheet would be

ActiveSheet.Name

> What is the parent of ActiveWindow?
>
> It's not available as ThisWorkbook.ActiveWindow or
> Application.ActiveWindow .
>
> Thanks.
NickHK - 26 Jan 2007 03:39 GMT
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

> What is the parent of ActiveWindow?
>
> It's not available as ThisWorkbook.ActiveWindow or
> Application.ActiveWindow .
>
> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.