Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Knowledge Base

   Products   Downloads   Sales   Support   About us
  Knowledge Base  Ask Cody  Manuals  Source Code Library  Resources



        
 
Can the terminal program allow read/write of data into Microsoft Excel?
 
Product: Distinct IntellitermTopic: DDELast updated: 3/31/2008
 
Q.: Can the terminal program allow read/write of data into Microsoft Excel?
A.: Yes, here's some sample code that should help you with this. This macro takes all the text from Intellitem's session and puts it into cell (1,1) of the current worksheet:

Sub test()
On Error GoTo ErrorHandler

crlf = Chr(13) + Chr(10)

iChanNum = DDEInitiate("ITERM", "1")

iNumRows = DDERequest(iChanNum, "Rows")(1)

iNumCols = DDERequest(iChanNum, "Columns")(1)

data = ""


If iChanNum Then

For Row = 1 To iNumRows

request = "P" + Mid(Str(1 + ((Row - 1) * iNumCols)), 2) + "L" + LTrim(Str(iNumCols))

request = request + crlf

r = DDERequest(iChanNum, request)(1)

data = data + r

Next Row


ThisWorkbook.ActiveSheet.Cells(1, 1).Value = data



Else 'could not open session

MsgBox "Could not open DDE Session with program."

End If

ErrorHandler:

DDETerminate iChanNum

End Sub



Do you find this information useful ?       Yes   No   Not Sure




Search by Keyword


If you did not find what you are looking for:


Products

 IP Sniffing
The Distinct Network Monitor is a protocol analyzer for Windows that includes both packet sniffing and network traffic statistical analysis tools.

 Intelliterm
The Most Complete Terminal Emulator for TN3270, TN5250 and DEC VT220 to VT420

 RPC for C and C++
The Fastest Way to Port Your Existing Unix-RPC Applications to Windows

  9/5/2008   Legal notices | PRIVACY Policy | Networking News |