LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
prompt a msg in loop code tkraju via OfficeKB.com Excel Programming 5 April 8th 09 05:59 AM
Registry path for links startup prompt XP Excel Programming 1 November 4th 08 01:40 PM
Prompt for Save Path - Use Cell Content for File Name Chris T-M Excel Programming 1 September 10th 08 09:59 PM
Excel XP SP3 and linked files prompt [email protected] Excel Programming 0 July 6th 05 09:46 PM
Excel prompt to save unmodified files Alan Excel Discussion (Misc queries) 3 March 17th 05 06:25 PM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"