I would try making your procedure a public function rather than a sub in a form module. Makes it more portable.
something along the lines of
Code:
Function fBrowse(PickType As MsoFileDialogType, Optional StartFolder As String = "", Optional strTitle As String = "") As String
On Error GoTo fBrowse_Error
Dim mso As Object
Dim varFile As Variant
If Nz(strTitle, "") = "" Then
Select Case PickType
Case 3
strTitle = "Select a File"
Case 4
strTitle = "Select a Folder"
Case Else
strTitle = ""
End Select
Else: strTitle = strTitle
End If
Set mso = Application.FileDialog(PickType)
With mso
.Title = strTitle
.AllowMultiSelect = False
.InitialFileName = StartFolder
.Filters.Clear
If PickType = msoFileDialogFilePicker Then
.Filters.Add "All Files", "*.*"
.Filters.Add "PDF file", "*.pdf"
.Filters.Add "Image Files", "*.jpg,*.jpeg,*.BMP,*.Png,*.TIFF,"
.Filters.Add "Audio Files", "*.Wav,*.mp4"
End If
If .Show = True Then
If .SelectedItems.Count = 0 Then
fBrowse = ""
End If
For Each varFile In .SelectedItems
fBrowse = varFile
Next
Else
fBrowse = ""
End If
End With
On Error GoTo 0
Exit Function
fBrowse_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure fBrowse, line " & Erl & "."
End Function
In your click event you would then use
Code:
Me.text34 = fbrowse(msoFileDialogFilePicker)