I am using the code below to open up a file dialogue box, to allow user's to locate and select a single file. The VBA code then goes on top perform a fair amout of processing. My issue is that the dialogue box remains on screen. I want to close it immediately. Any idea's
Dim fd As FileDialog
Dim ffs As FileDialogFilters
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
Set ffs = .Filters 'clear filters
With ffs
.Clear
.Add "Files", "*.*"
End With
.AllowMultiSelect = False
If .Show = False Then Exit Sub
Infile = .SelectedItems(1)
End With
Dim fd As FileDialog
Dim ffs As FileDialogFilters
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
Set ffs = .Filters 'clear filters
With ffs
.Clear
.Add "Files", "*.*"
End With
.AllowMultiSelect = False
If .Show = False Then Exit Sub
Infile = .SelectedItems(1)
End With