overlapped functions in vba for excel

B

blinkots

Hello All

I have written a vba app to get data from a device and display it on a
graph in excel. The data is fetched via the serial port using the Win32
communications api. These functions used are overlapped, hence the
other threads & applications run as normal during a relatively slow
communications.

Essentially the overall algorithm is:

cell =1
while cell < 100
if data available or timeout
place data or error in cell
cell++

This locks excel in the while loop, busy and cannot respond to user
commands. How do I put something in this loop to say ' check the rest
of excel needs'?

Thanks in anticipation.

Billy
 
B

Bob Phillips

Add

DoEvents

in each iteration of the loop.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top