Append to datatables using write range

How I define the cell number

LastRow Default no is 1

image

LastRow Increased adding 1 to data rows count

image

Out put not storing as expected

image

Thanks In advance.

HI @ManjunathReddy

Use the append range workbook activity instead of using the write range workbook activity.

If you use the write range workbook activity it overrides the data.
If you want to add the data into the existing excel use the append range workbook activity.

Hope it helps!!

@ManjunathReddy

Use “add Datarow” activity in your workflow and then use write range

Hi @ManjunathReddy

Use For each loop in that Use Write Cell activity
or
Use Append Range Workbook activity

@ManjunathReddy

Can you please tell what is not as expected?

What you you want to write?

Did you try with append range?

And is the extracteddatatable containing the values from excel? Which are already present? As I see you are taking the count of rows for that?yet again you are writing the same table back

Cheers

@Anil_G

All these are urls

image

one by one need to process and extract the data

So the extracted data should be store in one excel using write range.

Based on existing data I need append new data.

This is the problem statement.

Note : I should use only write range.

@lrtetala @rlgandu @mkankatala

Thanks for your response.

@ManjunathReddy

  1. Either use different sheets
  2. Before writing the data use a read range activity to read the data already present on excel sheet and then get the filled count and use that as start cell for next write range

So the process would be

  1. Read range on excel (if exists) and say stored in dt
  2. Then extract datatable from data extracted from url
  3. Write range with datatble as extract datatable and cell value or range as "A" + (dt.RowCount+1).ToString

Hope this helps

Cheers

@ManjunathReddy

If your datatable already contains data, then Use “add Datarow” activity in your workflow and then outside the for each loop use write range

Or If your datatable is empty build datatable with required columns then Use “add Datarow” activity in your workflow and then outside the for each loop use write range

Then in Cell field in the write range workbook activity.
Give the below one.
“A”+(Datatable.rowscount+2).toString

Then it will automatically append to the next cells in the existing excel file.

It works I already checked this one.

Hope it helps!!

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