Hiding a dialog box before continuing the next called macro


Posted by ElijahBlue on April 23, 2001 9:59 AM

I have a dialog box with a drop down menu, which the user uses to select a name to be queryed. When the user clicks ok it should close/hide the dialog box and call another macro. What is currently happening is that the program is not hiding the dialog box, until after the the called macro is completed. Is it possible to use the hide command in the OK_Click event to make the dialog dissappear before the called macro finishes? if not.. is there another way? I'm using Excel 5.0



Posted by Jerid on April 23, 2001 2:03 PM

Here is a sample of what I think your trying to do, I tested it and seems to work fine in Excel97

'I load the combo Box
Private Sub LoadComboBox1()
ComboBox1.Clear
ComboBox1.AddItem "Line 1"
ComboBox1.AddItem "Line 2"
ComboBox1.AddItem "Line 3"
End Sub

'OK Button Click Event
Private Sub cmdOK_Click()
ComboBox1.Visible = False
Call Macro1

End Sub

'Macro you want to call
Private Sub Macro1()
MsgBox "Test Code"
End Sub

You should set the visible property false before calling the macro, and make sure you haven't turned off screen updating.