Click here to Skip to main content
13,147,050 members (54,796 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I receive a Type Mismatch Error when my VA application executes the following line.

DDEChannel = Application.DDEInitiate(app:="RSLINX", topic:="CTLGX")

I can see the client and the data when using the controller manufacturers server so I know the topic is correct, I downloaded and installed a hotfix for W7 64. I am desparate so ANY help would be great.

Any suggestions would be helpful, I am stuck with DDE for now.
Posted 11-Oct-12 5:23am
Updated 11-Oct-12 9:54am
Sergey Alexandrovich Kryukov 11-Oct-12 11:54am
Who needs DDE these days, ever?!
Maciej Los 11-Oct-12 14:03pm
Very good question!
Sergey Alexandrovich Kryukov 11-Oct-12 15:30pm
Considering the history... when I had to start with networking, many Windows people tried to do NetDDE, and... TPC/IP... many did not know what it is, on Windows, NetBEUI dominated, NetBIOS -- can you imagine? and as to TCP/IP those people looked as "looks complex, difficult, some Unix stuff, who knows?..." I looked at that DDE and it seemed suspicious to me, what the hell? did not mess up, went with sockets... and now -- imagine how this DDE looks. :-)
jonsey29847 11-Oct-12 15:50pm
DDE is stil used in Autoplants, its legacy yes, but the consequences of changing it would be BIG bucks.
Sergey Alexandrovich Kryukov 11-Oct-12 15:53pm
Chances are, keeping it would result in even more bucks. :-)
jonsey29847 11-Oct-12 15:56pm
What makes you say that?
Sergey Alexandrovich Kryukov 11-Oct-12 17:15pm
Some experience... not with DDE, must admit :-)
jonsey29847 11-Oct-12 16:09pm
Not sure if first reply went through, as the auto companies retool the new technology surfaces. Recent advances in the processor now give us tag based addressing, a very big leap that took 20 years. Yes they do lag in technology, but even a small plant @ 500K square feet is $100 million just to build, tooling adds another $100 million or so, a final assembly plant runs into the billions. Yes its behind the times, but getting better, in 10 years I may not have to deal with DDE, and some suppliers have already abandoned it, but some of us still have to just deal.
Sergey Alexandrovich Kryukov 11-Oct-12 17:16pm
It all depends...
Wes Aday 11-Oct-12 16:01pm
What is DDEChannel declared as?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try to declare DDEChannel variable, then try to catch an error, for example, in this way:
Option Explicit
Sub TestDDE()
Dim DDEChannel As Long
On Error GoTo Err_TestDDE
DDEChannel = Application.DDEInitiate(App:="RSLINX", Topic:="CTLGX")
Application.DDETerminate (DDEChannel)

    Exit Sub
    MsgBox Err.Description, vbExclamation, Err.Number
    Resume Exit_TestDDE
End Sub

More about error handling/trapping, you'll find here:[^]

Using DDE in VB/VBA - useful links:
XL2000: VB examples using DDE[^][^][^]

Brother Google "says" that DDE on Win Vista/7 64b may generate some problems. Read these articles:[^][^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Thank you

I will read links, try catch, and repost.
DDEChannel is declared as a Long.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

DDE Channel is opening, I am using following code to open channel.
OpenRSLinx = DDEInitiate("RSLINX", "Sandbox")

And the following to get data from processor.
rslinx = OpenRSLinx()

And this line returns error 2023
ValveName = DDERequest(rslinx, "Reals[" & i & "], L1, C1")

Excel places #REF! in the target cell.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100