PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?QW5kcmV3?=
Guest
Posts: n/a
 
      8th Mar 2007
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.
 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      9th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:86527596-01C4-485E-92AA-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
Greg Glynn
Guest
Posts: n/a
 
      9th Mar 2007
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/

 
Reply With Quote
 
Greg Glynn
Guest
Posts: n/a
 
      9th Mar 2007
Have a look at this:

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

 
Reply With Quote
 
Greg Glynn
Guest
Posts: n/a
 
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emulating window.focus in Body onload() event and setting focus to a control on same page Jason Microsoft ASP .NET 4 7th May 2007 06:54 PM
catch IE download window event =?Utf-8?B?QmFsYQ==?= Microsoft ASP .NET 1 13th Oct 2005 09:23 PM
Catch drop event in excel =?Utf-8?B?RWRp?= Microsoft Excel Programming 1 20th Feb 2005 05:26 PM
How to catch KeyUp or KeyPress event in a modal window (ShowDialog) bill Microsoft Dot NET Framework Forms 1 16th Oct 2004 04:23 PM
How to catch the event when the user sets the focus or clicks to the Menu Bar in the explorer Ole Bergtun Microsoft Outlook VBA Programming 0 1st Jul 2003 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:00 PM.