Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Event triggered in Excel's cell by DDE

Hi.

I'm trying to trigger an event by using DDE to change a specific cell
in EXCEL.

First, i tested my own code (manually, without DDE) by changing that
cell's (cell B1) value and it worked. The code is as below:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
DoSomething
End If
End Sub

However, i tried to use another application and change the cell B1's
value via DDE, that event can't be triggered.

Can anyone give any suggestions? My intention is whever there's a
change in that cell's value, do something.

Thanks a lot.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Event triggered in Excel's cell by DDE

Link a cell's formula to the DDE cell. It can be as simple as =$B$1. Then
use the Worksheet_Calculate event. This unfortunately doesn't give you the
calculation of a specific cell the way Worksheet_Change does.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"albertleng" wrote in message
...
Hi.

I'm trying to trigger an event by using DDE to change a specific cell
in EXCEL.

First, i tested my own code (manually, without DDE) by changing that
cell's (cell B1) value and it worked. The code is as below:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
DoSomething
End If
End Sub

However, i tried to use another application and change the cell B1's
value via DDE, that event can't be triggered.

Can anyone give any suggestions? My intention is whever there's a
change in that cell's value, do something.

Thanks a lot.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Event triggered in Excel's cell by DDE

I would expect the change event to fire on a DDE update in xl2000 and later

However, you can also use the Old method of the SetLinkOnData method. See
VBA help for details.

--
Regards,
Tom Ogilvy


"albertleng" wrote:

Hi.

I'm trying to trigger an event by using DDE to change a specific cell
in EXCEL.

First, i tested my own code (manually, without DDE) by changing that
cell's (cell B1) value and it worked. The code is as below:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
DoSomething
End If
End Sub

However, i tried to use another application and change the cell B1's
value via DDE, that event can't be triggered.

Can anyone give any suggestions? My intention is whever there's a
change in that cell's value, do something.

Thanks a lot.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Event triggered in Excel's cell by DDE

I have solved my problem by Worksheet_Calculate(). This solution will
work as long as i dont have another formula in my excel which my excel
has none of it.

I will try SetLinkOnData when i have spare times.

Anyway, can anyone give any clue for me to try apart from DDE? I heard
of some other way of doing communication between different
application, like OLE automation and etc. Can anyone give some clues
for me to start from there?

Thanks.



On Jul 7, 8:45*pm, Tom Ogilvy
wrote:
I would expect the change event to fire on a DDE update in xl2000 and later

However, you can also use the Old method of the SetLinkOnData method. *See
VBA help for details.

--
Regards,
Tom Ogilvy

"albertleng" wrote:
Hi.


I'm trying to trigger an event by using DDE to change a specific cell
in EXCEL.


First, i tested my own code (manually, without DDE) by changing that
cell's *(cell B1) value and it worked. The code is as below:



Private Sub Worksheet_Change(ByVal Target As Range)
* *If Target.Address = "$B$1" Then
* * * DoSomething
* *End If
End Sub


However, i tried to use another application and change the cell B1's
value via DDE, that event can't be triggered.


Can anyone give any suggestions? My intention is whever there's a
change in that cell's value, do something.


Thanks a lot.


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 triggered by cell format change? Stefi Excel Programming 4 January 10th 06 12:35 PM
Event triggered by paste [email protected] Excel Programming 3 December 14th 05 09:03 PM
Macro triggered by an event AussieAVguy Excel Discussion (Misc queries) 2 June 16th 05 05:51 AM
Event triggered by cell data change/entry Fred Holmes Excel Programming 3 March 17th 05 02:13 PM
Worksheet_Change Event triggered off specific cell ExcelMonkey[_142_] Excel Programming 2 June 7th 04 03:33 AM


All times are GMT +1. The time now is 01:48 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"