INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

list files modified after a date/time

list files modified after a date/time

(OP)
Hi,
can somebody help me how to create a simple and fast running filesearch that returns a list of files last modified after a ceratin date/time?
I found .LastModified function which did not help me because it looks like I have to use this MsoLastModified constants.
Search will not run regulary (sometimes after one week or after two days or after 3 months). Therefore I save the date of last search and want to find later on all files modified after.
THX
Sven

RE: list files modified after a date/time



Hi,

What application are you using?

What do you mean by, "Search will not run regulary?"  Do you have code that you have used?  If so, please post.

Please answer ALL these questions.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: list files modified after a date/time

(OP)
Hi,
sorry for beeing not precise enough!
I'm still VBA beginner.

I'm using Microsoft EXCEL 2003.
With "Search will not run regulary" I mean that there are no fixed times when the script will run. It will be started manually in variable times.
Thats why the MsoLastModified constants are not suitable for me. I'd like to compare last modified date of found files with the date in Worksheets(1).Cells(1, 1) filled by last execution of the macro (to list only the new files after last run).
Here my filesearch - without any date comparisation becaus I don't know how:
    With Application.FileSearch
        .LookIn = "D:\project\"
        .Filename = "*.pdf"
        .SearchSubFolders = True
        .Execute
        If .Execute > 0 Then
            msgbox("There were " & .FoundFiles.Count & _
            " file(s) found.")
            Worksheets(1).Cells(1, 1).Value = Date()
            For i = 1 To .FoundFiles.Count
                Worksheets(1).Cells(1+i, 1).Value = .FoundFiles(i)
            Next i
        Else
            MsgBox "There were no files found."
        End If

    End With
 

RE: list files modified after a date/time



Try using the FileSystemObject.  The File object has a DateLastModified Property that you can compare to the date in your sheet.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close