@HareeshMRyour CountRows-11 is working but deleting rows very slow in 3 min it deleted 4 rows…so you can estimate to delete 1211 how long will it take…
Fine we can do one thing let’s read the whole table in excel with “” in the range and in the insert delete row activity we can mention the no of rows as outdt.Count-11
I did same thing as Hareesh mentioned, It’s working but it’s taking time to delete the row. It deleted the 4 rows in 2 min…forcefully I have to stop this.
total 1221 rows bro. and there are multiple sheet in this. I am deleting for specific sheet not for all. But it’s taking time, I already started the process but still it’s executing. Excel file size is 17 MB
The reason is not because of no of rows in the sheet where we are trying to delete the records and it’s because of the file size and moreover we are using this insert /delete rows inside the excel application and to access that size of file will usually take time buddy
But how long it takes makes the difference
Cheers @balkishan
Please reply bro. your both method either I put A12 in Read Range or read the complete sheet both are working but very - 2 slow. In 2 min it deleted 3 rows.
Any other method please let me know bro @Palaniyappan Excel screenshot attached FYI in previous comment. @HareeshMR
Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
excel = New Microsoft.Office.Interop.Excel.Application
wb = excel.Workbooks.Open(inputfolderpath + revenuefile, [ReadOnly]:=False)
excel.Visible = True
ws = CType(wb.Sheets("MT"), Microsoft.Office.Interop.Excel.Worksheet)
ws.Activate()
Dim rowCount = ws.UsedRange.Rows.Count
ws.Range("A12:G" + rowCount.ToString).Clear()
wb.Save()
wb.Close()
excel.Quit()
can you please tell me where I have to give the path, sheet name. and how do you specify the range is it right bro?
I didn’t see any thing where I have to specify the path.