ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Obtain imported file modified date (https://www.excelbanter.com/excel-programming/350779-obtain-imported-file-modified-date.html)

mikeburg[_62_]

Obtain imported file modified date
 

Help. Can someone please help me come up with the VBA code to obtain an
imported files modified date &:

(1) Place it in cell A1?

&

(2) Put it in a variable called FileDate?

Thanks a million. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=502519


tony h[_15_]

Obtain imported file modified date
 

if you create a function such as

Function fLastModified(ByVal strFileName As String) As Variant

Dim v As Variant
On Error GoTo AnError
v = FileDateTime(strFileName)

fLastModified = v
GoTo TheEnd
AnError:
fLastModified = Err.Description
TheEnd:
End Function


then you can refernce it either direct from the worksheet or in code

--
tony
-----------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=50251


Toppers

Obtain imported file modified date
 
Hi,
This gets Date Modified for a given file.

HTH

Sub DateStamp()
Dim FileData As Date
Path = "C:\Documents and Settings\User\My Documents\My Excel\"
MyStamp = FileDateTime(Path & "book1.xls")
Range("a1") = MyStamp
Filedate = MyStamp
End Sub

"mikeburg" wrote:


Help. Can someone please help me come up with the VBA code to obtain an
imported files modified date &:

(1) Place it in cell A1?

&

(2) Put it in a variable called FileDate?

Thanks a million. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=502519




All times are GMT +1. The time now is 10:05 AM.

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