Hi, I'm having trouble writing a continuious loop that works: Here's the issue.
I have a command button that calls a macro (Continuious) which has the following code:
Sub Continuious ()
DIM ContinuiousIsRunning as Boolean
If ContinuiousIsRunning then
ContinuousIsRunning = False
End
End IF
ContinuiousIsRunning=True
Do
DoEvents
Call Module1.MakeMeasurement ' Note this routine will make a
measurement, fill the result in an
array, the Array is linked to a chart
that shows the result of the
measurment.
DoEvents
Loop
End Sub
Here's the problems:
1)the chart never updates as the array changes with new data
2) I was hoping that the command button would still be active during the loop in order to hit another time to stop the endless loop.
Any help would be appreciated.
Thanks
I have a command button that calls a macro (Continuious) which has the following code:
Sub Continuious ()
DIM ContinuiousIsRunning as Boolean
If ContinuiousIsRunning then
ContinuousIsRunning = False
End
End IF
ContinuiousIsRunning=True
Do
DoEvents
Call Module1.MakeMeasurement ' Note this routine will make a
measurement, fill the result in an
array, the Array is linked to a chart
that shows the result of the
measurment.
DoEvents
Loop
End Sub
Here's the problems:
1)the chart never updates as the array changes with new data
2) I was hoping that the command button would still be active during the loop in order to hit another time to stop the endless loop.
Any help would be appreciated.
Thanks