Ondata isn't work with a DDE-Topic in Excel

mulderm

Member
Join Date
Jun 2003
Location
Netherlands
Posts
298
Hello,

In Excel I have place in cel A1 a topic: =RSLINX|'Testsol'!'N7:0'
This works excellent, a change in N7:0 in PLC/5 change also
in cel A1.
Then I wrote the follow code in de VBA Module1:
sub Auto()
worksheets("DDE").Ondata="Start"
end sub

sub Start()
channelnum=DDEInitiate("RSLINX", "Testsol")
data1=DDERequest(channelnum, "N40:0")
DDETerminate channelnum
range("D1").value=data1
end sub

When the value in cel A1 change, nothings happens.
It looks that the Ondata event not working.
I want to use a triggerbit to run my macro.
What do I wrong?

Greetings,

mulderm
 
Last edited:
Mulderm,

Warning I don’t know anything about VBA but have messed with it and was able to get it to work.

With that said what are you trying to do?

Bob O.
 
Hello Bob,

I found it.
I must make a workbook_open event in my THISWORKBOOK and place
the follow code:
worksheets("DDE").Ondata="Start"
Because these must run a first time.

mulderm
 

Similar Topics

Howdy everyone, I have a project that i am duplicating on an older version of the same cell. With all the additional stuff that has been added the...
Replies
3
Views
997
I'm a bit lost. I don't understand why my HMI (Simatic 1200) is not recognising any PLC tags. From the ethernet comms page , all seems OK. Yet...
Replies
15
Views
2,095
I have an 1746SC-CTR8 card which isn't appearing in the IO configuration list. I have added the EDS file for the card, is there anything else I...
Replies
10
Views
1,938
Howdy! I'm trying to figure out some issues with time. I've got a ControlLogix running a flow totalizer (FIT_4520_TOT) that was setup to reset at...
Replies
2
Views
1,242
Hi all, I have a client who wanted to upgrade their PC workstation using NI Lookout and Windows XP. Eventually they want me to replace Lookout...
Replies
0
Views
1,103
Back
Top Bottom