vba code to find original file information?

N_Mitch

Board Regular
Joined
Jan 23, 2007
Messages
146
G'day,

Is there any code which can display the original file information? The type of information I need is as follows:

File location
Date
Excel version
Created by whom

Thank you,

Mitch
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
dont know about date and crated by whom but following code shows the file location and excel version

Code:
Sub ShowInfo()
MsgBox "File location: " & ThisWorkbook.Path & Chr(13) & _
"Version: " & Application.Version
End Sub
 
Upvote 0
and this is the creation date:

Code:
Sub ShowInfo() 
MsgBox "File location: " & ThisWorkbook.Path & Chr(13) & _ 
"Version: " & Application.Version & chr(13) & _
"Creation Date: " & FileDateTime(ThisWorkbook.Path & "\" & ThisWorkbook.Name)
End Sub
 
Upvote 0
Thanks iggydarsa

However, what I want to know is the original file location where the file was created in. I'm not sure if this information is stored in a file or not.

In other words, even where a file has been copied, or SavedAs, to a new location, is there some vba code that can display the original file location?

Thanks,

Mitch
 
Upvote 0
This code should give the info:
Code:
Sub ListStuff()
    Range("B3").Value = "Workbook Path"
    Range("B4").Value = "File Creation Date"
    Range("B5").Value = "Application Version"
    Range("B6").Value = "Created by:"
    
    Range("C3").Value = ActiveWorkbook.Path
    Range("C4").Value = ThisWorkbook.BuiltinDocumentProperties(11).Value
    Range("C5").Value = Application.Version
    Range("C6").Value = ThisWorkbook.BuiltinDocumentProperties(3).Value
End Sub
 
Upvote 0
Excellent!

That was just what I was after, John (although I would have really liked the orig file location as well!).

Thanks,

Mitch
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,681
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top