Get Timestamp from File path present under Excel application scope

Hi,

How to get the Timestamp from the file path where the filepath is given in the Excel file.
Elaborately saying , the bot should open the excel file and read the Path from the excel column and I need to get the timestamp of that path. How to achieve this?

Regards,
Indhu.

@Indhumathi_P

have a look on this Expression ->
Cdate(Now.ToString).ToString("hh:mm:ss")

image

Hi,

File.GetLastWriteTime method might help you, as the following.

Regards,

Hi Yoichi,
It is working for word file but not for Excel, can you please suggest on this

Regards,
Indhu

Hi,

Can you share your issue in detail? Maybe, GetLastAccesstime or GetCreationtime help you.

New Fileinfo(FilePath).CreationTime

Hi @Yoichi and @Gangadhar_Athili
I have tried for all the above cases like:
i)system.IO.File.GetLastWriteTime(row(“FilePath”).ToString)
ii)File.GetLastAccessTime(row(1).ToString)
iii)new FileInfo(row(1).ToString).CreationTime

I am getting the output as below:
i)For word File ,getting the system default Timestamp as 01/01/1600 05:30:00 but not the Exact timestamp when it is created in system. Find the below Image.
image

ii)For Excel File , am getting the below Error:
image

My issue is, I need to take the timestamp of the file(word and Excel) when it is initially created/Saved in the system and the timestamp of the same files after making any changes.
Can you please suggest me on this.

Regards,
Indhu

Hi,

This error shows your filepath is invalid format. So, can you check your path string? ( or can you share it?)

Regards,


Hi,
This the path of the File and it is working now by using File.GetLastAccessTime(string) without any error. But I am getting the timestamp as 01/01/1600 05:30:00 for both the word and Excel files not the exact timestamp of the file.

Regards,
Indhu