Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

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

VB
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
Updated 11-Oct-12 9:54am
v2
Comments
Sergey Alexandrovich Kryukov 11-Oct-12 11:54am    
Who needs DDE these days, ever?!
--SA
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. :-)
--SA
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. :-)
--SA

Try to declare DDEChannel variable, then try to catch an error, for example, in this way:
VB
Option Explicit

Sub TestDDE()

Dim DDEChannel As Long

On Error GoTo Err_TestDDE

DDEChannel = Application.DDEInitiate(App:="RSLINX", Topic:="CTLGX")
Application.DDETerminate (DDEChannel)


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


More about error handling/trapping, you'll find here: http://support.microsoft.com/kb/146864[^]

Using DDE in VB/VBA - useful links:
XL2000: VB examples using DDE[^]
http://support.sas.com/resources/papers/proceedings12/077-2012.pdf[^]
http://fa.sammicomputer.co.kr/TECH/html/performi.htm[^]

Brother Google "says" that DDE on Win Vista/7 64b may generate some problems. Read these articles:
http://social.technet.microsoft.com/Forums/en-US/excel/thread/7c8f845d-c4aa-4627-9008-3251d2772536[^]
http://social.technet.microsoft.com/Forums/en-US/office2007deploymentcompatibility/thread/c42f825d-b7e8-48c8-b5af-30563b839f09[^]
 
Share this answer
 
Thank you

I will read links, try catch, and repost.
DDEChannel is declared as a Long.
 
Share this answer
 
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900