How could I set the date at the same time with append range?

Okey, my next question is simple too.
I have 2 excels with for example this names: Excel1 and Excel2. With append range I put the info of Excel1 under the info of Excel2, but at the same time I want to add the real date on the column w (I have this to the real date) =>
DateTime.Now.ToString(“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture)

  • I have this:
  1. Read Range.
  2. Excel Application Scope. Inside of this I have:
    - Assign activity, with this code:
    TablaMB52.AsEnumerable.Take(TablaMB52.Rows.Count - 1).CopyToDataTable
  3. And last one, append range.

So, what can I do to add the real date at the same time with the other data for each row at the column w? Thanks

looks like an update datacolumn case:
How to Update Data Column Values of a Data Table | Community Blog

@ShadowZ

So Is your Datatable is having the Date column present else you can use Add Data Column activity

Also use For Each row activity and use Assign activity, write as below

row(“DateColumn”) = Now.ToString(“dd/MM/yyyy”)

Hope this will help you

Thanks

Okey, I’m triying to do it with the activities of the link :ok_hand:

Sorry, but this doesn’t work. I’m doing it like this but I’m having an error on the destination.

2022-01-28 09_22_54-490698062 - AnyDesk

@ShadowZ

Is 22 is the name of the row

OR if this is the Index then you have to write as

row(22)

Hope this may help you

Thanks

I’m having the same problem. It’s the number of the column, but I tried with the name and doesn’t do anything.

Okey, thanks you for your help. Finally I set the date of each row inserted with LINQ thanks to you two. I used this code:

For Each row As Datarow In dtTable.AsEnumerable

row(“Date”) = Now.ToString(“dd/MM/yyyy”)

Next

Okey, thanks you for your help. Finally I set the date of each row inserted with LINQ thanks to you two. I used this code:

For Each row As Datarow In dtTable.AsEnumerable

row(“Date”) = Now.ToString(“dd/MM/yyyy”)

Next

Thanks a lot

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.