Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Trigger an Excel VBA event from another application

I can send a message to a dotNet Textbox and have it trigger the
TextBox_Change event. What I want to do is the reverse. I want to send a
message from dotNet to Excel VBA and have it trigger some event so I can
immediately respond to the event. Since I can't get a Handle for any of the
VBA controls, I'm not having much luck. I can send a message that changes
the Form Caption but this doesn't trigger any event that I can find, and I
want to stay away from a polling technique.

Any ideas would be appreciated.

mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Trigger an Excel VBA event from another application

Mike,
Since you can't get the HWnd, SendMessage is useless.
Can you not use Automation to control Excel ?

NickHK

"Mike" wrote in message
...
I can send a message to a dotNet Textbox and have it trigger the
TextBox_Change event. What I want to do is the reverse. I want to send a
message from dotNet to Excel VBA and have it trigger some event so I can
immediately respond to the event. Since I can't get a Handle for any of

the
VBA controls, I'm not having much luck. I can send a message that changes
the Form Caption but this doesn't trigger any event that I can find, and I
want to stay away from a polling technique.

Any ideas would be appreciated.

mike




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Trigger an Excel VBA event from another application

I'm not familiar with Automation. If you could give me just a few more
words, I could start Googlin'.

thanks

"NickHK" wrote in message
...
Mike,
Since you can't get the HWnd, SendMessage is useless.
Can you not use Automation to control Excel ?

NickHK

"Mike" wrote in message
...
I can send a message to a dotNet Textbox and have it trigger the
TextBox_Change event. What I want to do is the reverse. I want to send a
message from dotNet to Excel VBA and have it trigger some event so I can
immediately respond to the event. Since I can't get a Handle for any of

the
VBA controls, I'm not having much luck. I can send a message that changes
the Form Caption but this doesn't trigger any event that I can find, and
I
want to stay away from a polling technique.

Any ideas would be appreciated.

mike






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Trigger an Excel VBA event from another application

Mike,
I don't use .net language, but you need Interop etc AFAIK.
Here's a start :
http://support.microsoft.com/kb/301982

NickHK

"Mike" wrote in message
...
I'm not familiar with Automation. If you could give me just a few more
words, I could start Googlin'.

thanks

"NickHK" wrote in message
...
Mike,
Since you can't get the HWnd, SendMessage is useless.
Can you not use Automation to control Excel ?

NickHK

"Mike" wrote in message
...
I can send a message to a dotNet Textbox and have it trigger the
TextBox_Change event. What I want to do is the reverse. I want to send

a
message from dotNet to Excel VBA and have it trigger some event so I

can
immediately respond to the event. Since I can't get a Handle for any of

the
VBA controls, I'm not having much luck. I can send a message that

changes
the Form Caption but this doesn't trigger any event that I can find,

and
I
want to stay away from a polling technique.

Any ideas would be appreciated.

mike








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Trigger an Excel VBA event from another application

Mike,

You can call a method in Excel VBA from .NET assembly but you cannot
get an event back in the assembly from VBA code.
If this is what you want to do, get the Primary Interop Assemblies for
Excel, reference them in your .NET project and use the
Excel.Application object. A method named "Run" is used to call a VBA
macro.

regards

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event trigger in Excel? Tim Miller Excel Programming 1 May 24th 06 09:02 PM
Excel VBA Programming...How to Trigger an Event WhenYou Move Off a Cell [email protected] Excel Programming 2 April 17th 06 11:11 PM
unable to get the excel app event trigger for for window resize [email protected] Excel Programming 0 November 30th 05 03:03 AM
Excel VBA event trigger problem Milli[_2_] Excel Programming 4 April 26th 04 08:46 AM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"