I have an excel addin that lets me get the modified date of a file, but it is not working now.
Can you help me debug it? It works perfectly for someone else in my company and failed for others. Thank you for any help you can offer.
Here is the code:
Function FileModDate(filespec)
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
FileModDate = f.DateLastModified
End Function
In the excel cell A2 I put c:\temp\Ben-Terry.pdf
In the excel cell B2 I put filemoddate(A1)
The error I get is: #VALUE!
Can you help me debug it? It works perfectly for someone else in my company and failed for others. Thank you for any help you can offer.
Here is the code:
Function FileModDate(filespec)
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
FileModDate = f.DateLastModified
End Function
In the excel cell A2 I put c:\temp\Ben-Terry.pdf
In the excel cell B2 I put filemoddate(A1)
The error I get is: #VALUE!