View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Mscomm1 buffer problem

Joel,
Those two statements appear functionally equivalent to me
Do While C1 = True

to
Do While C1

what was the significance of this suggestion?

as to looping, It looks like he is starting a loop to query the comm
controls continuously. given that information I don't see where two buttons
would be needed.

to the original poster. Have you tried putting your Timedelay between
issuing the call statement and when you get the input data?

--
Regards,
Tom Ogilvy




"Joel" wrote:

You should have two routines. One to handle each button.

Private Sub CommandButton21_Click() and
Private Sub CommandButton23_Click()

the while should be changed
from
Do While C1 = True
to
Do While C1

there also isn't any condition to exit the while loop. Don't know why you
need to loop. The sub will only get called when the button is clicked unless
you need to read the serial device multiple times.
"gtslabs" wrote:

I changed the 2 lines to send to the textbox to read:

UserForm1.TextBox1 = Application.Clean(Buffer1$)
UserForm1.TextBox2 = Application.Clean(Buffer2$)

And I still go the same error.

I am calling the code from a commmandbutton on the userform1