Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default 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
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
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Checking range of cells for entry then checking for total Barb Reinhardt Excel Programming 1 October 13th 06 02:47 PM
getting filenames jim9912 Excel Programming 3 March 30th 06 05:55 PM
all filenames on A:\ into Excel? Norbert Jaeger Excel Programming 0 March 1st 06 11:47 AM
Getting filenames via VBA Andrew Excel Programming 5 April 15th 05 12:41 PM


All times are GMT +1. The time now is 01:46 PM.

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

About Us

"It's about Microsoft Excel"