VBANovice,
If you are looking for a way to get the folder path as per the user's
selection, then you'll need some API calls. If this is your intention, then
you'll find SHGetPathFromIDListA and SHBrowseForFolderA useful. Chip has
this laid out on his website at the following link if you don't want to use
MSDN to piece the API calls (and their associated structures) together
yourself:
http://www.cpearson.com/Excel/BrowseFolder.aspx. If this is not
what you are looking for, then please be more specific as to how you want to
prompt the user and how you intend on using the user's result in your code.
Best,
Matthew Herbert
"VBANovice" wrote:
I have the code below and it works fine but I would like it to prompt for the
file path as each month the path changes slightly.
Sub LoopOWC()
Dim oFSO
Dim Folder As Object
Dim Files As Object
Dim file As Object
Application.ScreenUpdating = False
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = oFSO.GetFolder("c:\new_files\Jan")
For Each file In Folder.Files
If file.Type Like "*Microsoft Excel*" Then
Workbooks.Open Filename:=file.Path
UploadData
ActiveWorkbook.Close SaveChanges:=True
End If
Next file
Set oFSO = Nothing
Application.ScreenUpdating = True
End Sub