I've been trying to ensure that a VB6 form's command button is only clicked once. Clicking twice gets the "component request pending" error message (action can't be completed because other application is busy etc... switch to/retry). I've tried enabling (T/F) the button (same result), and the code below, which does change the command button to red but still generates the error if the button is clicked again while the form is visible. Hiding the form before calling the InsertFormula routine doesn't work ie. quickly double clicking the button causes the same error. The insert formula routine open's an XL file, inserts formulas then saves the file and quits the application. Any suggestions will be appreciated. Dave
[VBA]
Private Sub command2_Click()
If Form1.Command2.BackColor = RGB(255, 0, 0) Then
Exit Sub
End If
Form1.Command2.BackColor = RGB(255, 0, 0) 'red
Call InsertFormula
Form1.Hide
[/VBA]