INSERT FILEDATE INTO CELL COMMENT

S

Simon

Hi
Can any one offer some code to insert the modified date of an external xls
file into a cell comment.
Thanks
Simon
 
B

Barb Reinhardt

This should get you started.

Sub test()
Dim myString As String

myString = ""
On Error Resume Next
myString = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
On Error GoTo 0
If Not myString = "" Then
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=myString
End If

End Sub
 
R

Rick Rothstein

Give something like this a try...

Dim LastModDateTime As Date, FilePathName As String
.......
.......
FilePathName = "C:\Users\Rick\Documents\Book1.xls"
LastModDateTime = FileDateTime(FilePathName)
 
S

Simon

Thanks Barb
But does this looks like it places the date for the current workbook date. I
am looking to place the date of a completely seperate workbook.
Unless I misread this.
Thnaks
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top