Consulting

Results 1 to 7 of 7

Thread: Solved: EXCEL communicating with hyperterminal

  1. #1

    Lightbulb Solved: EXCEL communicating with hyperterminal

    hi,
    i am trying to cause information gathered through the hyperterminal communication connection (COM1) at windows XP, to flow into an Excel sheet.
    is it possible to create using VBA code at the excel prog.?
    does anyone have a similar vba code?

    live long and prosper,
    itays

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Two ways I know of:
    If you have Visual Studio 6 then you can use the Microsoft Communications Control: http://www.pencomdesign.com/support/...re_example.htm
    http://msdn.microsoft.com/en-us/library/aa231237(VS.60).aspx

    Otherwise you are stuck using the Win32 API
    http://msdn.microsoft.com/en-us/library/ms810467.aspx

    Threads on this here:
    http://stackoverflow.com/questions/5...-port-from-vba
    http://www.tek-tips.com/viewthread.c...=560230&page=1

    There appears to be a working example here: http://www.thescarms.com/vbasic/commio.aspx
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  3. #3
    thanks!
    you really made it the great!

    itays

  4. #4
    VBAX Contributor
    Joined
    Oct 2004
    Posts
    159
    Location
    Quote Originally Posted by Oorang
    Two ways I know of:
    -----
    Otherwise you are stuck using the Win32 API
    http://www.vbaexpress.com/forum/showthread.php?t=26979
    -----
    This link seemed show this thread only , can you update it

    thanks

  5. #5
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  6. #6
    VBAX Contributor
    Joined
    Oct 2004
    Posts
    159
    Location
    Thanks

  7. #7
    VBAX Newbie
    Joined
    Aug 2013
    Posts
    1
    Location
    Quote Originally Posted by itays View Post
    thanks!you really made it the great!itays
    Hi,My code is as below and I used exactly the same from the working example. However, I got an error " Compile error: Sub or function not defined"Would you mind to share with me the code see if which part of the code I might have missed.Thanks. Sub TESTIOICC() Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4 Dim lngStatus As Long Dim strError As String Dim strData As String ' Initialize Communications lngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), _ "baud=9600 parity=N data=8 stop=1") If lngStatus 0 Then ' Handle error. lngStatus = CommGetError(strError) MsgBox "COM Error: " & strError End If ' Set modem control lines. lngStatus = CommSetLine(intPortID, LINE_RTS, True) lngStatus = CommSetLine(intPortID, LINE_DTR, True) ' Write data to serial port. lngSize = Len(strData) lngStatus = CommWrite(intPortID, strData) If lngStatus lngSize Then ' Handle error. End If ' Read maximum of 64 bytes from serial port. lngStatus = CommRead(intPortID, strData, 64) If lngStatus > 0 Then ' Process data. ElseIf lngStatus < 0 Then ' Handle error. End If ' Reset modem control lines. lngStatus = CommSetLine(intPortID, LINE_RTS, False) lngStatus = CommSetLine(intPortID, LINE_DTR, False) ' Close communications. Call CommClose(intPortID)End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •