View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
VBANovice VBANovice is offline
external usenet poster
 
Posts: 12
Default prompt for path to loop through files

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