Hi
Follow of these code you can open port and read data from Hyper Terminal:
Option Explicit
Private Buffer As String
Private Sub Form_Load()
MSComm1.CommPort = 3
MSComm1.Settings = "9600,N,8,1"
If MSComm1.PortOpen Then
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.CommPort = 1
If Not MSComm1.PortOpen Then
MSComm1.PortOpen = True
Else
MsgBox "Warrning!:fail to open port."
End If
End If
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
Buffer = MSComm1.Input
MyParser
End Select
End Sub
Private Sub MyParser()
Do While Len(Buffer) <> 0
Text1.Text = Text1.Text & ""
IF MSComm1.InBufferCount > 0 Then
Buffer = Buffer & MSComm1.Input
End IF
Loop
End Sub
Additionally you can use this link
http://msdn.microsoft.com/en-us/library/aa168292(v=office.11).aspx[
^] for write your data from Excel file and you can download example of Mscomm follow of this link
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7585&lngWId=1[
^] ;)
Best Regards.