Excel Logic

Hi All,

We have more than one .xlsx file at shared location. Normally Robot process each and send an email if it processed successful.

Currently if there 1 input file at share location the Robot will process it , if it processed successfully then it will send an email. Here We have to add name of file which processed , that file name wanted to add in email . How we can achieve. ?

also if there are 5 input files at shared location and 3 processed successfully and 2 failed then in email we have mention the name of which processed successfully. How we can achieve. ?

Regards,
Shirish

@Shirish

Try like this:

StrFiles [ ] = Directory.GetFiles(“FolderPath”,“*.xlsx”)

The above expression will give array of Excel files exists in that folder.

String fileName = path.getFileNameWithOutExtension(strFiles(0))

How we can add file name in email?

Hi @lakshman

Loop through for each item

For each item in strfiles

Add item in send mail

Thanks
Ashwin.S

@Shirish

Here, I stored the file name in string variable fileName and pass it into mail.