Button on Userform calling GetOpenFilename

W

Werner Rohrmoser

Hello,

Situation:
Userform with Button, Button_Click Procedure contains "Application.GetOpenFilename".
When I have done my file selection the GetOpenFilename dialog
will be closed and I see the calling Userform.
Now the Userform seems to be not modal, I can select cells,
sheets, but I can't enter values in the cells.

Question:
How can I avoid this behaviour, I'd like to have a modal userform as it is declared.
Thanks

Best Regards
Werner
 
H

Harald Staff

Hi Werner

Weird. I never noticed.
Seems to behave ok if you hide - show the userform though:

Private Sub CommandButton1_Click()
Me.Hide
TextBox1.Text = Application.GetOpenFilename
Me.Show
End Sub

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top