Dim Buffer As Variant '存储数据的缓冲区
Dim ReadData() As String '数据数组
Dim str as String
Buffer = MSComm1.Input '清理接收缓冲区,此时,接收的字节数已经为0
ReadData()=buffer
'将变体赋值给一个字节型数组
For i = LBound(ReadData) To UBound(ReadData)
Str = Str & ChrB(ReadData(i))
Next i
MsgBox "数据:" & vbCrLf & Str
前段时间写过这样的程序,可以运行,仅供参考