When you think about serial communications, Microsoft Excel isn’t typically the first program that springs to mind. But this spreadsheet has a rather powerful scripting language hidden away inside it, which can, with a little coding, be used to send and receive data over your serial port (Internet Archive Link, as of 2023). The scripting language is called Visual Basic for Applications (VBA), and it has been a part of Microsoft’s Office suite since 1993. Since then, it has evolved into a powerful (if sometimes frustrating) language that offers a subset of the features from Visual Basic.
It can be a useful tool. Imagine, for instance, that you are logging data from an instrument that has a serial port (or even an emulated one over USB). With a bit of VBA, you could create a spreadsheet that talks to the instrument directly, grabbing the data and processing it as required straight into the spreadsheet. It’s a handy trick that I have used myself several times, and [Maurizio] does a nice job of explaining how the code works, and how to integrate this code into Excel.
If you’re looking for other ways to leverage this Excel feature, consider watching movies at work or building a virtual machine inside of your sheets.
https://www.youtube.com/watch?v=IrVA1BBHFHw
https://www.youtube.com/watch?v=HZ6Q224UPkc
btw above demo is made in excel 2003, notice how the sheets go back and forth it’s actually using double buffering. cool stuff
if anyone wants to look at the source ftp://ftp.scene.org/pub/parties/2009/breakpoint09/console_real_wild/excelence_bb_bp09_wild.zip
wow i remeber this,
thanks for sharing
One of my first jobs was to write a VBA script in Excel to connect to a PLC (programmable logic controller) via a serial port to read in data for further analysis. That was in the late 90’s
That took me back to this project: http://www.awce.com/gp3excel.htm
However, by far the worse abuse of a spreadsheet I’ve ever committed was here: http://www.drdobbs.com/embedded-systems/cpu-design-on-paper/240153480
I’m so ashamed!
I’d rather open the serial port in Python and then… wait, what was the question again?
I loath excel. While you can do some really funky things with it, it doesn’t mean you should…….
Thanks for the article, I think this is an great way to log the data coming from my Arduino.
I’ve seen some other tools that people have written to log and graph serial data, but it’s nice being able to do it with software that’s already installed on my computer and is familiar to me (as opposed to installing python and having to figure out which command prompt I’m supposed to use to write code and which one to use to run code. Ugh).
Don’t listen to the jerks out there, I think you guys at HaD do an awesome job!
Ooops, I have hit report button instead of reply. You can save your Arduino data into csv or tsv file via Python. That has the added advantage of being human and Excel readable.
BUT you can collect your data from an embedded system and populate the spreadsheet directly. i.e. integrated. This has the added advantage of plot them *live* and not having to go the *extra step* of importing *after* collecting them.
Does anyone have a suggestion how to do this in OpenOffice?
I’d only hope the people who wrote that had more sense than to include such an unrestricted programming language.
HaD, the comments section gets really confusing when you delete something. Any way you could do in place deletes, reddit style?
For fun and games or perhaps the odd on-off job in a strange evironment, excel is goog enough for the job, but for evrything else it is a disaster in the making. Remember everytime sombody uses excel for a production job, a puppy dies.
Yeah, VBA, what a work of genius. A spreadsheet / word-processed document that can access the friggin’ disk, email people, and generally dick with your hardware. And wait, there’s more! An email function, so your word-processor can send viruses to your other dumb friends who use a screwdriver as a hammer. But no problem! Here’s a virus scanner that’s also a plasma rifle for “Halo”.