when you get the fie date check that like
If File_Date > Date -15 Then
...

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> I have a function which does the following:
>
[quoted text clipped - 11 lines]
> Many thanks
> SteveH
SteveH - 13 Sep 2006 11:12 GMT
Ok so I need to add to the following statement:
If oFile.DateLastModified > dtLastUpdated Then
sLatestFile = oFile.Name
dtLastUpdated = oFile.DateLastModified
End If
so it looks like :
If oFile.DateLastModified > dtLastUpdated Then
If File_Date < Date -15 Then
sLatestFile = oFile.Name
dtLastUpdated = oFile.DateLastModified
End If
I am not sure what Else clause I should put in here. Basically, if it
is older than 15days I want it to be ignored and a msgbox to be shown
saying "File needs updating" or something similar.
> when you get the fie date check that like
>
[quoted text clipped - 23 lines]
> > Many thanks
> > SteveH
SteveH - 13 Sep 2006 11:58 GMT
I have updatedthe following statement in my function to the following:
If oFile.DateLastModified > dtLastUpdated Then
If oFile.DateLastModified < Date - 15 Then
sLatestFile = oFile.Name
dtLastUpdated = oFile.DateLastModified
Else
MsgBox ("Spreadsheet has not been Updated")
End If
End If
When I test this by using a spreadsheet qith a LastModifiedDate of
13/07/2006 I would expect it NOT to be process and recieve the msg
above. However the file is being processed as normal.Can someone
pleeeeease tell me what is wrong with my syntax before I go nuts!
Thanks
> when you get the fie date check that like
>
[quoted text clipped - 23 lines]
> > Many thanks
> > SteveH
Bob Phillips - 13 Sep 2006 12:08 GMT
You have the test the wrong way round, your test will check for files MORE
than 15 days old.

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> I have updatedthe following statement in my function to the following:
>
[quoted text clipped - 41 lines]
> > > Many thanks
> > > SteveH
SteveH - 13 Sep 2006 12:50 GMT
I have switched it roudn but it still seems to be ignoring this
statement and processing anyway.
> You have the test the wrong way round, your test will check for files MORE
> than 15 days old.
[quoted text clipped - 51 lines]
> > > > Many thanks
> > > > SteveH