PDA

View Full Version : VBA: Excel 2003 Macro OPEN command for RS232 input



Tbird
03-01-2011, 08:10 AM
I have a macro in Excel 2003 which captures incoming data from an RS232 port. Data is sent to the computer every minute. The code I am using:

Open "com1:" For Input As #1

This macros had been working fine for years for capturing the data from the RS232. Sometime since Sept 2010 and Feb 2011 something changed. Maybe there was an update for MS Office??

The problem: The capturing seems to lag now. Instead of showing the data on screen every minute when it comes into the system it holds it in some kind of buffer for 4 samples (4 minutes of samples) then spits them all out at once. This problem is reproduceable 100% of the time.

Things I have tried: The computer was changed and the issue was still there. Used Hyperterminal (Windows XP) and the samples are seen every minute by Hyperterminal.

So why would Excel VBA now start doing this lag in data all of a sudden after years of running perfectly? It is a very simple code and worked well.
Any ideas would be welcomed!

Thank you