Excel related issue

Hi,
please help me finding issues
the bot is downloading an excel sheet with current data and time. for example, if the bot is downloading file,
19-03-202000:32
19-03-202000:33

need to compare the latest two excel file always (duplicate check)

Hai @hamid_hussain… For what u need to compare? Aftr the comparison what u want to do? Frame clearly

after comparing if file does not duplicate i need to convert latest downloaded file to csv

please let me know if u have any idea

@hamid_hussain… Create a separate variable for all of the Excel sheets… Use if condition ,For example (Excel1) Not Equals(excel2) then use read range in Excel application scope and will give output as datatable. And then use write CSV activity to write that datatable and specify the file path.
let me know is this working

Use the Invoke Code activity to get the two newest *.xlsx files within a folder:

IOrderedEnumerable<FileInfo> Files = new DirectoryInfo("C:\\").GetFiles("*.xlsx").OrderByDescending(f => f.LastWriteTime);
if (Files.Count() > 0)
	FirstWorkbook = Files.ElementAt(0).FullName;
if (Files.Count() > 1) 
	SecondWorkbook = Files.ElementAt(1).FullName;

Pass the arguments: FirstWorkbook and SecondWorkbook (both of type String) to the Invoke Code activity as In/Out. After the code’s execution you are able to use FirstWorkbook and SecondWorkbook. Start off with an If activity ensuring there are at least two workbooks. Then compare them using the workbook activities available.