While not actually correct, that subject line hopefully caught the
attention of someone in the know.
Neophite here, so be gentle with the OO terminology and please excuse
my weird choise of terminology, if the case. I'm still srtuggling
with "method", "property" and the like...
So there's no mistake, I am using VBA in Excel.
Short version:
A CheckBox is greyed out and inactive until the event handling Sub
exits. I want to halt that code by unchecking the box, but it is
grey and inactive. Trying to set various available Button.Properties
=False in the code to allow this didn't work.
Long:
I have a check box.
When I click (an event) on it (either to check or unckeck) it fires
some code in the corresponding Macro Sheet (Sheet1 in this case).
That Sub then determines if it is checked or not ( If CheckBox1 Then)
and does the appropriate thing by calling a Sub in one of the other
Modules. This "other code" does its thing, finishes, all the End
Subs cause execution to go the back from whence it came (in true
subrouting RETURN form) and exits the event Sub in Sheet1. This I
have working just fine for many such check boxes, buttons and pull
downs.
Here's the rub.
I want to have that "other code" run and run doing something, then
UNCHECK the box to stop that code from running and go back to the
idle state.
However, the box stays greyed-out (disabled in some form) until the
origainal event Sub ends. --- "Obviously" to prevent a re-entrant re-
entry, so to speak.
I can set the check box value (and other properties) to false in
code to change its state, but it is still in-active until that Event-
fired End Sub executes.
In hopes of helping with this, I also tried to find something
like EventSuspend, but no such luck. This is where the event is
captured, but not allowed to fire any code until Events are
resumed... (There's only EventEnable = True/False).
Background...
I'm already doing non-overlapped (synchronous, can't do anything till
buffer is sent) serial I/O very successfully (been digging into
MSDN). Sending commands and receiving responses. I want to be able
to sit and wait for serial input, but turn that mode on and off with
a CheckBox. I don't think I can pull off overlapped I/O (Event or
interrupt driven), just yet, so I thought I'd try polling the port,
but I want to stop polling by un-checking the box.