PDA

View Full Version : [SOLVED] Dynamic Data Exchange Code



gnaga
03-23-2005, 05:32 AM
Hi,

I used to get data from a third party software through its DDE server using Visual Basic. The same code is given below.



Option Explicit
Option Base 1
Const LINK_NONE = 0
Const LINK_MANUAL = 2
Const SERVICE$ = "SERVER3500"
Const TOPIC$ = "CHANNELDATA"
Const RACKNO$ = "1"

Private Sub Get_Data()
txtDDEContent.LinkMode = LINK_NONE 'THIS IS TO RESET THE LINK
txtDDEContent.LinkTopic = SERVICE & "|" & TOPIC
txtDDEContent.LinkMode = LINK_MANUAL
txtDDEContent.LinkItem = Format$(RACKNO, "00") & "/" & Format$(2, "00") & "/" & Format$(1, "00")
txtDDEContent.LinkRequest
End Sub

Private Sub Delink_Server()
txtDDEContent.LinkMode = LINK_NONE
End Sub


This was done with single PC. I mean the server and my code run on same machine.

Now the server (third party software) is running in one PC which is connected in the LAN (peer to peer). In another PC we run office 97.

I want to collect the same data using excel VBA code. I do not know how to change the code to suit for excel VBA.

Can some one help me for this?

TIA
GNaga:doh:

gnaga
03-24-2005, 06:51 AM
When I further pursued on the problem I found two problems

1. Since I am trying from the network PC Windows NET DDE Service should run on both PC's

2. If we are requesting data from the net work PC the service name and topic name should be NDDE$ & CHANNELDATA$ respectively. This is for this particular third party software.

Thanks for your views & Time

GNaga:hi: