Updating File date instead of JUST Reading

Jan 27, 2015 at 4:03 PM
So I utilize this task to scrape the last modified date from an excel file for two reasons:

1.) To validate that data from the spreadsheet isn't older than 24 hours
2.) To populate a variable that inserts the last modified date into a table through the package.

This all works great, when I execute the package directly from SSMS, it pulls everything perfectly. However - running this job manually every night isn't ideal. So we set up an Agent job to kick it off. Here's where it gets tricky.

When executing as an Agent job, the File Properties task seems to update the last modified date on the file rather than just read it and insert it into the variable. This raises two issues for the job:

1.) We cannot validate whether the data in the file is older than 24 hours since this is being updated to when the job runs
2.) The date being populated in the table with the data in the spreadsheet will now reflect the last run time of the job rather than when the data was last modified.

Again, this does NOT happen when I execute the package directly from SSMS, only when executed from the Agent. There are no errors and the package runs fine outside of this one issue.

Any insight as to how to keep this from updating the file properties would be appreciated.