ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Links and Linking in Excel (https://www.excelbanter.com/links-linking-excel/)
-   -   Displaying File Timestamp of Another Excel File (https://www.excelbanter.com/links-linking-excel/195904-displaying-file-timestamp-another-excel-file.html)

[email protected]

Displaying File Timestamp of Another Excel File
 
I have a link from an external Excel file displaying data within my
(current) Excel file.

To make sure I am pulling the latest version of the data and
displaying the timestamp of that
latest data, is there a way to display the timestamp of that external
file within my (current)
spreadsheet?


Many thanks....

(previously posted to microsoft.public.excel.charting)

Bill Manville

Displaying File Timestamp of Another Excel File
 
Put this in a standard module in your workbook:

Function FileDate(FileName As String) As Date
Application.Volatile
FileDate = FileDateTime(FileName)
End Function

Put this in a cell in a worksheet in your workbook
=FileDate("C:\Temp\MyFile.xls") [amend as appropriate]


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


[email protected]

Displaying File Timestamp of Another Excel File
 
On Jul 22, 7:17*pm, Bill Manville wrote:
Put this in a standard module in your workbook:

Function FileDate(FileName As String) As Date
* Application.Volatile
* FileDate = FileDateTime(FileName)
End Function

Put this in a cell in a worksheet in your workbook
=FileDate("C:\Temp\MyFile.xls") *[amend as appropriate]


Thanks, Bill, but for some reason I get a "#NAME?" error after pasting
the function
in the VB editor for that sheet, and putting the "=FileDate()" in a
cell in my workbook.
Suggestions? I am in an office with MS Office permissions tightly
controlled, so I cannot
download add-ins or install new software without Helpdesk
intervention.

Dave Peterson

Displaying File Timestamp of Another Excel File
 
Did you put the function in a General module?
Did you allow macros to run when you opened the workbook?

And you did really put the full path to the other file in your formula, right?

=FileDate("C:\Temp\MyFile.xls")

wrote:

On Jul 22, 7:17 pm, Bill Manville wrote:
Put this in a standard module in your workbook:

Function FileDate(FileName As String) As Date
Application.Volatile
FileDate = FileDateTime(FileName)
End Function

Put this in a cell in a worksheet in your workbook
=FileDate("C:\Temp\MyFile.xls") [amend as appropriate]


Thanks, Bill, but for some reason I get a "#NAME?" error after pasting
the function
in the VB editor for that sheet, and putting the "=FileDate()" in a
cell in my workbook.
Suggestions? I am in an office with MS Office permissions tightly
controlled, so I cannot
download add-ins or install new software without Helpdesk
intervention.


--

Dave Peterson


All times are GMT +1. The time now is 08:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com