Hi There,
I'm looking for the VBA code that firsts prompts the user to select a folder where the files are stored and then searches for a specified file. The full filename does not always remain, so i need to search with a part name something like Processed-File will be present in the filename.
I'm able to pick the folder where the files are located but not able to automatically select the file that i'm looking for
This is the code i have got so far which isn't working;
SourceDir = Application.FileDialog(msoFileDialogFolderPicker).Show
SourceDir = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems.Item(1)
With Application.FileSearch
.LookIn = "SourceDir"
.FileType = msoFileTypeExcelWorkbooks
.Filename = "Processed-File*.xls"
.Execute
End With
Appreciate any help in completing this task
Cheers
Bookmarks