This is something I have read up on but still have not yet figured out how to correctly implement.
In this particular case, I am trying to make a module for my file dialog window that I can just call whenever I want a file picked in a routine.
So if my module is:
How do I handle passing strfile back to the main procedure?
In this particular case, I am trying to make a module for my file dialog window that I can just call whenever I want a file picked in a routine.
So if my module is:
Code:
Public Sub FilePicker()
Dim fd as Object
Dim strfile as String
Set fd = Application.FileDialog(3)
With fd
.allowmultiselect = False
.Filters.Clear
.Filters.Add "Excel Files", "*.xls*"
If .Show Then
strfile = .selecteditems(1)
End If
End With
How do I handle passing strfile back to the main procedure?
Last edited: