Luckily, when Windows copies a file even across a network it retains the timestamps. So, I can compare which person and what computer has the 'latest' version of a file and use it to sync all the others. I sent zilpher a pm on this, but can anyone tell why the above code transposes the day and the year in the file modified time if used with a day greater than 12?
I haven't been able to recreate the problem you speak of but I suspect it's down to the file date system on our two machines. I tried using the 'wrong' file system for my machine but didn't get the same problem, but I would suggest you try changing the AdjustFileTime function thus: Code:. You must log in or register to reply here. Similar threads T. Replies 0 Views Sep 24, tutu Question Working with large spreadsheet of Data.
ShogunStealth Dec 10, Excel Questions. Replies 2 Views Dec 10, Alex Blakenburg. SeaTigr Nov 8, Excel Questions. Nov 8, SeaTigr. Question Issue with opening multiple files via a file name list via VBA.
Replies 6 Views Jun 13, ewenger. Question Change "Date modified" to "Date created". Replies 7 Views Mar 18, Joe4. But it prints a wrong date. My setup is like. The problem is when I open this file , in the File tab it shows correct Last Modified Date but when I get it through VBA it shows some old date;any help in this regard is really appreciated since I am not getting why this issue. Hi, Has anyone written a piece of vba code that can check the last modified date of a specific file? Thanks very much, Jon.
In nearly all circumstances, you will want this parameter to be False. Possible errors include passing the name of a non-existent file or a invalid value for WhichDateToGet.
The result time is adjusted to reflect Daylight Savings Time. It is one of the value of the FileDateToProcess enum described above. Since Windows displays file times in local time format, the displayed file time will be N hours later or earlier if you are East of GMT than the time passed in as FileDateTime. It returns NULL if an error occurred:. You can download the bas module files here or a complete workbook with examples here. Neither Excel nor VBA provide a mechanism for retrieving or changing the file times of a file.
Therefore it is necessary to use additional Windows API functions to convert the FileTime value of a file's times to the local time zone. Asked 8 years, 8 months ago. Active 5 years, 1 month ago. Viewed 46k times. Will appreciate help to include the "Date Last Modified". Santosh here is complete code with comments indicating modifications. Community Bot 1 1 1 silver badge.
Can u put the complete code along with changes you made? Santosh below is complete code along with modifications — user Add a comment.
0コメント