Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with getting filenames & then checking for new
Hey all,
I have a number of files on a server (in different directories) that are periodically updated/added to by other users. (1) I need to programatically build a list of those filenames and then (2) to compare the above list to what's on the server and if any are new (on the server) to get the new filename(s) and file parameters (such as if it were a music list, then filename, artist, modified date, etc., etc.). I'm really hoping I don't have to type all of the current filenames and parameters into the list first. Thanks sooooooo much for any help, Don |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with getting filenames & then checking for new
Here is some code to show you how to open all files in a folder
Dim oFSO Sub LoopFolders() Set oFSO = CreateObject("Scripting.FileSystemObject") selectFiles "c:\MyTest" Set oFSO = Nothing End Sub '--------------------------------------------------------------------------- Sub selectFiles(sPath) '--------------------------------------------------------------------------- Dim Folder As Object Dim Files As Object Dim file As Object Dim fldr Set Folder = oFSO.GetFolder(sPath) For Each fldr In Folder.Subfolders selectFiles fldr.Path Next fldr For Each file In Folder.Files If file.Type Like "Microsoft*Excel*Worksheet*" Then Workbooks.Open Filename:=file.Path 'do something Activeworkbook.Close SaveChanges:=False End If Next file End Sub -- __________________________________ HTH Bob "DonW" wrote in message ... Hey all, I have a number of files on a server (in different directories) that are periodically updated/added to by other users. (1) I need to programatically build a list of those filenames and then (2) to compare the above list to what's on the server and if any are new (on the server) to get the new filename(s) and file parameters (such as if it were a music list, then filename, artist, modified date, etc., etc.). I'm really hoping I don't have to type all of the current filenames and parameters into the list first. Thanks sooooooo much for any help, Don |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Spell Checking with checking cell notes | Excel Discussion (Misc queries) | |||
Checking range of cells for entry then checking for total | Excel Programming | |||
getting filenames | Excel Programming | |||
all filenames on A:\ into Excel? | Excel Programming | |||
Getting filenames via VBA | Excel Programming |