N
Nicholas Dreyer
I have a lengthy process, call it My Process, started by clicking a
button from a userform.
MyProcess can take a few minutes, and while it's running I want all
excel user interfacing disabled. In excel 97 I simply surrounded the
call to MyProcess in CommandButton_Click(), where CommandButton is the
button on the form that starts the process, with lines like the
following setting the userform Enabled property to False and back to
True again:
Private Sub CommandButton_Click()
Me.Enabled = False
MyProcess
Me.Enabled = True
End Sub
This works fine in excel 97, but in excel 2000 and 2003 excel remains
locked up after exiting CommandButton_CLick and I have to do
<ctrl><Break> to regain control of excel again. In order to be
convinced that MyProcess is not interacting in some unexpected way
with excel, it is easy to replicate the situation by creating a simple
userform with one button called CommandButton and the following code:
Private Sub CommandButton_Click()
Me.Enabled = False
Me.Enabled = True
End Sub
One click on CommandButton locks up excel as described above.
<ctrl><break> puts you on the line that does the userform.show, and a
check on userform.Enabled at then confirms it is True, even though the
CommandButton remains quite inaccessible.
What am I missing here?
Nick
button from a userform.
MyProcess can take a few minutes, and while it's running I want all
excel user interfacing disabled. In excel 97 I simply surrounded the
call to MyProcess in CommandButton_Click(), where CommandButton is the
button on the form that starts the process, with lines like the
following setting the userform Enabled property to False and back to
True again:
Private Sub CommandButton_Click()
Me.Enabled = False
MyProcess
Me.Enabled = True
End Sub
This works fine in excel 97, but in excel 2000 and 2003 excel remains
locked up after exiting CommandButton_CLick and I have to do
<ctrl><Break> to regain control of excel again. In order to be
convinced that MyProcess is not interacting in some unexpected way
with excel, it is easy to replicate the situation by creating a simple
userform with one button called CommandButton and the following code:
Private Sub CommandButton_Click()
Me.Enabled = False
Me.Enabled = True
End Sub
One click on CommandButton locks up excel as described above.
<ctrl><break> puts you on the line that does the userform.show, and a
check on userform.Enabled at then confirms it is True, even though the
CommandButton remains quite inaccessible.
What am I missing here?
Nick