12-02-2009, 03:13 PM
Hi Mahesh,
You have a solution to delete all the previous records
1.First find out the how many records available in results.xls (Ex: 30)
Note: Here u can find the number of previous records from
rcount=objWorkbook3.Worksheets("Sheet1").UsedRange.rows.count (Use the results object to get the count)
2.Now u want to delete these rows from the excel
Note: Use the below code to delete the previous records
--------
--------
with the above code will delete the (Ex:30) records
You have a solution to delete all the previous records
1.First find out the how many records available in results.xls (Ex: 30)
Note: Here u can find the number of previous records from
rcount=objWorkbook3.Worksheets("Sheet1").UsedRange.rows.count (Use the results object to get the count)
2.Now u want to delete these rows from the excel
Note: Use the below code to delete the previous records
Code:
set aa=Createobject("Excel.Application")
set bb=aa.Workbooks.open("D:\venkatbatchu.xls")
set cc=aa.worksheets("sheet1")
Code:
rcount= here this value u might be getting from this (rcount=objWorkbook3.Worksheets("Sheet1").UsedRange.rows.count )
Code:
for i=1 to rcount step 1
cc.Rows(1).Delete
Next
bb.save
aa.workbooks.close
with the above code will delete the (Ex:30) records