Arduino to Excel VBA interactive


I'm new to the Arduino although I have dabbled with other microcomputers in the past. I'm also reasonably experienced with Excel VBA.

I want to develop an Excel Form that will interact with the Arduino. ie I want to be able to receive data and send data to/from the Arduino and the Excel form.

I have successfully used the Open "Com4: 9600" for binary access read write as #1 and been able to accept data from a number of devices (eg the ultrasonic distance sensor and the temp/humidity sensor). The problem i am having is sometimes the link breaks and the Input(1,,#1) will hang if there is no input. this crashes Excel as even ctrl/break doesn't work. I'm also having to write my own code to construct a line of input 1 character at a time (not too difficult but there must be a better way).

I've tried looking for a more elegant method but everything seems to be unsupported anymore (eg PLX-DAQ, mscomm32) or just doesn't work (eg MSCOMM32 can't be trusted so VBA wont let me put it on the form).

I can't believe this requirement (to enable a robust dialogue between Excel VBA and an Arduino) is not a common one and that it hasn't been cracked already, so if it has can someone tell me the best current solution.

I'm using Excel as part of Office 2013.


The problem you describe is familiar in rs232 communication. What often is needed is to have error recovery handles in the datastream. This means you need to send data as packets with some additional control info in it. A typical packet looks like a sequence of chars.

start data data data … checksum end e.g. <1,2,3,4,10>

< and > are start and end chars, 10 is a simple checksum (sum) of the datafields.
The datafields in the example are csv format.

If you encounter a start character before the previous packet has ended you can only ignore the packet and optionally ask for a resend if possible.

This means quite a bit extra code on both sending and receiving side.

Wingnut: unsupported anymore (eg PLX-DAQ,

There is plenty of support with PLX-DAQ v2 on this forum. I believe it works two-way. Better see what NetDevil did before you go out and re-invent the wheel.

Thanks for both replies.

Yes I see that PLX-DAQ is quite alive on this forum (as opposed to the PLX website).

I've started to use it and am beginning to understand the code. It's cool.

I've been exploring with the Arduino and got it to do stuff with the commands, but right now I am developing a new form to be populated with GPS Sentences as they come in through a USB/Com port. So basically I'm skipping the built in commands and just using the comms framework to connect and get lines for me to process in CustomDevPointLineRead().

Glad I don't have to re-invent all that comms stuff - way above my understanding.