ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to catch the event when an Excel window gets focus? (https://www.excelbanter.com/excel-programming/384837-how-catch-event-when-excel-window-gets-focus.html)

Andrew

How to catch the event when an Excel window gets focus?
 
Hello, friends,

I am using Excel in our C#.net applicaiton. I need to catch the events when
the launced Excel window gets focus. I tried

AppEvents_WorkbookActivateEventHandler
AppEvents_WindowActivateEventHandler

It worked fine when more than one .xls files were opened and I switched
between those Excel windows. However, it did not worked when there was only
one open .xls file and I switeched between this Excel window and other apps,
for example, after using IE, I came back to the Excel, non of the above
events fired.

How to get around this problem since I really need to catch this event? Any
ideas?

Thanks a lot.

NickHK

How to catch the event when an Excel window gets focus?
 
Andrew,
From a VBA point of view, there is no exposed event that tells you this.
Solutions include using a timer to check the window with focus or
subclassing for the appropriate message.

I can't say if there is anything available from a .Net/COM addin
perspective.

NickHK

"Andrew" wrote in message
...
Hello, friends,

I am using Excel in our C#.net applicaiton. I need to catch the events

when
the launced Excel window gets focus. I tried

AppEvents_WorkbookActivateEventHandler
AppEvents_WindowActivateEventHandler

It worked fine when more than one .xls files were opened and I switched
between those Excel windows. However, it did not worked when there was

only
one open .xls file and I switeched between this Excel window and other

apps,
for example, after using IE, I came back to the Excel, non of the above
events fired.

How to get around this problem since I really need to catch this event?

Any
ideas?

Thanks a lot.




Greg Glynn

How to catch the event when an Excel window gets focus?
 
There are 3rd party tools that do this, but I can't locate an API in
my brief search. AUTOMATE does it, but it's not free.

www.NetworkAutomation.com/AutoMate/


Greg Glynn

How to catch the event when an Excel window gets focus?
 
Have a look at this:

http://groups.google.com/group/micro...8d1026e3dd6667


Greg Glynn

How to catch the event when an Excel window gets focus?
 
http://groups.google.com/groups/sear...ion+Gets+Focus



All times are GMT +1. The time now is 01:16 PM.

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