I want to delete all data in excel sheet in 2 method ( 1st -with header, 2 nd - without header) , because in 1 st sheet i need header only and in 2nd sheet is in blank no data.
Delete sheet data without deleting sheetname and the data has A - ZZZ clmns the columns and dynamic, . But i want to delete the the datas in excel sheets
Use the “Excel Application Scope” activity to open the Excel file.
Use the “Read Range” activity to read the data from the sheet.
Check if the read data contains any rows using the “DataTable.Rows.Count” property. If it is greater than 0, proceed with the next step.
Use the “Clear Range” activity to clear the entire sheet, including the header.
Method 2: Delete all data excluding header
Use the “Excel Application Scope” activity to open the Excel file.
Use the “Read Range” activity to read the data from the sheet.
Check if the read data contains any rows using the “DataTable.Rows.Count” property. If it is greater than 1, proceed with the next step.
Use the “Write Range” activity to write a blank row in the sheet starting from the second row until the last row to clear the data. Note that you should only write one blank row if there is only one data row in the sheet.