×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

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!

*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.

Students Click Here

Excel 2000: How to display full path and DateCreated in cell?

Excel 2000: How to display full path and DateCreated in cell?

Excel 2000: How to display full path and DateCreated in cell?

(OP)
I need to have a cell in an Excel worksheet display the full path of the file and the date the file was created or maybe modified.  I've worked with VBA in Access, but never in Excel.

RE: Excel 2000: How to display full path and DateCreated in cell?

You can add this code to the sheet's object. This is for the complete path and filename. I am not sure how to get the date the file was originally created.

Private Sub Worksheet_Activate()
    Range("A1").FormulaR1C1 = ThisWorkbook.FullName
End Sub

RE: Excel 2000: How to display full path and DateCreated in cell?

(OP)
Thanks, but why does it display the old location after I move it then open it again?  If I go to other worksheets then back to the Sheet1 the location refreshes.  When does this Worksheet Activate event fire if not on the opening of the Workbook?

RE: Excel 2000: How to display full path and DateCreated in cell?

That subroutine runs when the worksheet is activated (upon switching sheets). If you want this to update only once, when the workbook is opened, add this code to a module (not the sheet object).

Sub Auto_Open()
    Range("A1").FormulaR1C1 = ThisWorkbook.FullName
End Sub

I am sure that there is a way to get the file creation date, but I am not sure exactly how. I will poke around, but in the meantime, I am sure that one of the other experts in this forum can help.

RE: Excel 2000: How to display full path and DateCreated in cell?

(OP)
That's closer.  This is how I rewrote it:
In a module for the ThisWorkbook object

Private Sub Workbook_Open()
    Sheet1.Range("A2").FormulaR1C1 = ThisWorkbook.FullName
End Sub

It doesn't matter if the user renames Sheet1 or the cell A2 as these are absolute references.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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! Already a Member? Login

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