Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Changing the Date/Time Stamp

Now the clocks have gone back, and I forgot to change the time on my camera,
the time shown as the file creation date/time is now out by an hour.

How can I change this time in a VBA subroutine?

I have a routine wot does it, but this relies upon the presence and use of a
programme called "TOUCH.COM" that I don't have on this computer.

I had hoped that this line would work:-
Set f.DateLastModified = myTest2
....but it doesn't, so I resorted to creating a batch file.....

Here's the relevant part of the routine:-

Select Case DoWhat
Case Is = "ReName"
If NoDuplicate(LastRow, FirstRow, N, "B") _
And Len(Trim(Range("B" & N).Value)) 0 Then
OldName = myFolderName & Range("A" & N).Value
If Len(Ext(NewName)) = 0 Then _
NewName = NewName & "." & Ext(OldName)
Name OldName As NewName
Else
Range("B" & N).Font.ColorIndex = 3
Range("B" & N).Font.Bold = True
myText = "We have a duplicate name !"
End If
Case Is = "ReDate"
NewDate = Range("D" & N).Value
For M = 1 To .FoundFiles.Count
myTest1 = FileNameAndExt(.FoundFiles(M))
myTest2 = Worksheets("Sheet1").Range("A" & N).Value
If myTest1 = myTest2 Then
Set f = FSO.GetFile(.FoundFiles(M))
If Worksheets("Sheet1").Range("D" & N).Value < ""
Then
myTest1 = f.DateLastModified
myTest2 = Worksheets("Sheet1").Range("D" &
N).Value
myTest1 = "C:\Progra~1\Utilities\touch " & _
myShortPath(.FoundFiles(M)) & _
" /D:" & myWord(1, myTest2, " ")
& _
" /T:" & myWord(2, myTest2, " ")
' e.g. "C:\Program Files\Utilities\touch" 0891*.JPG
/D:26/02/2005 /T:15:04:00 /T:15:04:00
WriteThisToFile MyBatchFile, myTest1
'Set f.DateLastModified = myTest2
End If
M = .FoundFiles.Count
End If
Next M
Case Else
End Select



Regards

Robin
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
Comparing 2 files on date/time stamp, and based time difference do a subroutine [email protected] Excel Programming 1 September 28th 07 03:53 AM
Date-Time Stamp [email protected] Excel Discussion (Misc queries) 1 September 27th 06 02:37 PM
date/time stamp Jan Excel Worksheet Functions 7 July 14th 05 01:04 PM
Date/time Stamp? Bowes813[_3_] Excel Programming 7 June 3rd 05 08:10 AM
Date time stamp Frank Kabel Excel Programming 3 March 1st 04 08:56 PM


All times are GMT +1. The time now is 10:51 PM.

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

About Us

"It's about Microsoft Excel"