Reading serial data into Excel using VB

I'm new here and just learning following a nice demo kit I was bought as a gift! Hopefully I'm not creating a new thread that has already been addressed as I've been searching for a solution for a long time.

I'm trying to read the analogue values from the Uno directly into excel and the problem I'm having is strange. My VB code can read the serial port (COM3) and all works correctly providing I have previously run serial monitor in Arduino. If not it just does nothing and then stops responding. Is there something that serial monitor does to trigger the arduino transmit? 1 thing I do notice is that serial monitor causes a reset whereas my VB code doesn't (even when working).

I can post code here if needed but I'm guessing it's something really simple that I'm missing!

Thanks in advance of any help!

Is there something that serial monitor does to trigger the arduino transmit?

No, but it does everything needed to properly open the serial port. If your application isn't doing all those things, communication doesn't happen.

1 thing I do notice is that serial monitor causes a reset whereas my VB code doesn't (even when working).

It should.

I can post code here if needed but I'm guessing it's something really simple that I'm missing!

Correct. it's the code...

The serial monitor sets the DTE bit to true.

Here is an example in vb.net (visual Studio 2015). The VBA syntax will be different.

        ' Create a new SerialPort object with default settings.
        _serialPort = New SerialPort()

        ' Allow the user to set the appropriate properties.
        _serialPort.PortName = SetPortName(_serialPort.PortName)
        _serialPort.BaudRate = SetPortBaudRate(_serialPort.BaudRate)
        _serialPort.Parity = SetPortParity(_serialPort.Parity)
        _serialPort.DataBits = SetPortDataBits(_serialPort.DataBits)
        _serialPort.StopBits = SetPortStopBits(_serialPort.StopBits)
        _serialPort.Handshake = SetPortHandshake(_serialPort.Handshake)
        _serialPort.DtrEnable = True

OK, thanks for replies. Sounds like the DTE bit to true could be something then. Here is my VBA code:

COMport = FreeFile
    Close COMport
        
    Open "COM3:38400,N,8,1" For Random As #COMport Len = 1
    'Application.Wait (Now + TimeValue("00.00.05"))    
    Debug.Print Now; "Started"
         
    chars = Clear
   
        While Worksheets("Sheet1").Range("i9").Value < timeout
        
        'Get 1 byte
        Get #COMport, , byte1
        
        If byte1 = Asc(vbCr) Then              'CR byte received, so write chars string to sheet cell
          
            rowOffset = rowOffset + 1
                       output() = Split(chars, " ")
                       timeCell.Offset(rowOffset, colOffset).Value = output(0) / 1000
                       dest1Cell.Offset(rowOffset, colOffset).Value = output(1)
                       dest2Cell.Offset(rowOffset, colOffset).Value = output(2)
                       dest3Cell.Offset(rowOffset, colOffset).Value = output(3)
                       dest4Cell.Offset(rowOffset, colOffset).Value = output(4)
                       dest5Cell.Offset(rowOffset, colOffset).Value = output(5)
                       runtime.Offset(rowOffset, colOffset).Value = (output(0) / 1000) - Worksheets("sheet1").Range("a2").Value
                       extimeCell.Offset(rowOffset, colOffset).Value = Now()
                                           
                       time1Cell.Value = output(0) / 1000
                       output1Cell.Value = output(1)
                       output2Cell.Value = output(2)
                       output3Cell.Value = output(3)
                       output4Cell.Value = output(4)
                       output5Cell.Value = output(5)
                       timeoutCell.Value = (Worksheets("sheet1").Range("i8").Value - Worksheets("sheet1").Range("a2").Value)
            chars = Clear
                 
        Else
            'Append byte as an ASCII character to chars string
            chars = chars & Chr(byte1)
            
        End If
             
        
    Wend
    
    Close #COMport
    Debug.Print Now; "Finished"

Apologies it’s a bit messy, I’ve been fiddling around with it for a few hours. when it does work, the reading of the data and splitting it into the other variables works really well.

Is there something in the Open “COM3:38400,N,8,1” that i can chamge to set DTE to true?

Or anything else obvious from the code?

Thanks!