I need your help for an Excel automation via datatable.
I had attached a sample of the Excel file.
i had to send mail based on the value of a colomn:
for each reference cell i had to send an email like this:
"to: EMAIL PRO ( for this Reference Cell)
subject: “refrence cell”.
Body:
Hello,
Please find the files for “code gestion” (for this reference cell) :
-name1 surname1 (for this reference cell)
-name2 surname2 (for this reference cell)
"
i think i had to sort the datatable by reference cell, do some other tricks, have you any idea to share with me? sample.xlsx (23.9 KB)
To Sort “Reference cell” column in ascending order : InputDt = (InputDt.AsEnumerable.OrderBy(Function(x) x(“Reference cell”).ToString)).CopyToDataTable
To Sort “Reference cell” column in descending order : InputDt = (InputDt.AsEnumerable.OrderByDescending(Function(x) x(“Reference cell”).ToString)).CopyToDataTable
Please refer to the following thread which will help you to understand how to sort the data in table based on 1 column or multiple columns and in different orders.
I’m not clear with your requirement. Can you please elaborate more on how do you want to send the email, what data needs to be extracted or where you’re facing issue.
@rohith.prabhu in the Excel sample there is a column named “Reference cell”.
i need to send 1 mail per group of “Reference cell”, eg (in the sample)
i will send 1 mail for “141” , in subject of the mail i put this Reference cell", and in the boy i will write all the “Pays de naissance” related to this “cell reference” here:
in the body of the mail :
“Non trouvé”,
“Non trouvé”,
“France”,
“France”