V
VBANovice
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
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