Excel Filter - Update in same Sheet

Hi Team,

I need to remove 1 month old data from the excel sheet and need to place in the same sheet.

My Input and Output will look like this

image

image

Please note following concerns I have
1.) I cannot delete and re-create same file due to business needs
2.) I cannot use “Excel Application Scope”, I can only use Work Book activities, since sometimes excel app scope is throwing error(HRESULT: 0x800AC472) and from the management they have decided not to use this across my organisation

image

I have the filtered DT with me, no problem in filtering, the issue for me is to update back in the same sheet

If you can give me idea how to clear excel sheet before I use Write Range that will be sufficient. Please suggest

@Deeipauk

Write Range is sufficient for you in this case

For reference you can see the below post

Mark as solution if this helps

Thanks

1 Like

Write range will overwrite the data, if sheet has 5 data after filter I have 3 data, then last 2 rows will remain same, finally wrong data will be there in the sheet

Thnks for your reply

@Deeipauk

Hope this may helps you

  1. Read Range - Dt1
  2. BuildDatatable - Dt2 with empty data
  3. Write Range - Use Dt2 so that it will remove the data
  4. Filter Datatable - Dt1
  5. Write Range - Use Dt1, so you will get the filtered Data only

Mark as solution if this may helps you

Thanks