![]() |
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 |
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 |
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