Private Function showFileDialog(ByVal title As String) As String Dim selectedFileName As String selectedFileName = "" With Application.FileDialog(msoFileDialogOpen) .title = title .AllowMultiSelect = False .InitialFileName = ThisWorkbook.path If .Show = -1 Then selectedFileName = .SelectedItems(1) End If End With showFileDialog = selectedFileName End Function