Hello,
I am currently an Electrical Engineering Intern looking for some guidance.

I've been tasked with finding a way to use VBA in Excel to control various pieces of hardware like an Arduino, Oscilloscope, a USB relay module, and a DMM through the USB ports on my computer. These devices just need to take in their inputs and send them to Excel for evaluation.

However I don't understand how the communications work and how to manipulate VBA to control those external entities. I've read many forums on Google about "VBA Serial Communication". Some used MSComm32 and NETComm. Some involved a third party software that did all the communications for you(PDX-something). Some just used the Windows API library. Some used a library that someone else created.

In trying these different ways there was always one of two problems.

1) The code I tried did not work in VBA. Either it was meant for VB in Visual Studio or it was outdated like MSComm32. That or i received errors for reasons I could not understand.



2) The second and most common problem was these codes couldn't answer my original questions;

Are all of the solutions I found online still relevant?

If so what am I missing that makes them work within VBA?

If they do work then how do you use VBA to tell these pieces of hardware to do anything, receive any data, or send some data?

Is there a list of commands that should be in the data sheet for each of the pieces of hardware that I am missing? Commands that tell the hardware to give VBA the voltages they are receiving?

Excel's Data Streamer seems to manage the "receive data" portion just fine so is coding the same process in VBA possible?




I am extremely new and very open to the possibility that there is a common thread between all of the pieces of information I have read, that I've just not found yet.

Any advice or information would be much appreciated. This will all go into my rapidly expanding OneNote notebook about Serial Communication. Thank you in advance from a overly curious student.