PDA

View Full Version : [SOLVED:] Solved: Get file location in textbook upon clicking button



ilyaskazi
05-11-2005, 06:22 AM
In my userform, there is one textbox and button near to it.

Upon clicking that button, i want "Browse dialog box window" to open and get the location of my file in this textbox.

Bob Phillips
05-11-2005, 06:42 AM
Private Sub CommandButton1_Click()
Dim fName
fName = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If fName <> False Then
Me.TextBox1.Text = fName
End If
End Sub

Paleo
05-11-2005, 06:53 AM
Hi ilyaskazi,

if I understood you right what you need is this:



Dim Arq As String
Arq = Application.GetOpenFileName("Excel File, *.xls")
txtTextBo1.Text = Arq


I am assuming your textbox's name is txtTextBox1.