Obtain imported file modified date  
Author Message
Budmischief





PostPosted: Wed Jan 18 11:10:03 CST 2006 Top

Excel Programming >> 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.hide-link.com/ ;userid=24581
View this thread: http://www.hide-link.com/

Excel192  
 
 
Toppers





PostPosted: Wed Jan 18 11:10:03 CST 2006 Top

Excel Programming >> 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



>
> 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?action=getinfo&userid=24581
> View this thread: http://www.excelforum.com/showthread.php?threadid=502519
>
>
 
 
tony





PostPosted: Wed Jan 18 11:08:43 CST 2006 Top

Excel Programming >> 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?action=getinfo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=50251