Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Modified File Organization Roadsignologist Excel Discussion (Misc queries) 3 December 18th 08 04:34 PM
Date modified changes when file not saved BAC Excel Discussion (Misc queries) 5 January 3rd 08 12:49 PM
Last modified date of a linked file tjc Excel Discussion (Misc queries) 8 August 31st 07 04:30 PM
date file modified Matthew Excel Discussion (Misc queries) 2 October 11th 06 06:52 PM
insert the date the file was last modified Hoff Excel Discussion (Misc queries) 8 November 21st 05 01:31 PM


All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"