i too hav faced the same issue when updating result of each test data iteration to pass or fail in excel.so i hav implemented counter foreach iteration and closed the ddt driver before writing the excel file. and after writing again open i hav opened the ddt driver and incremented the counter sometthing lik this
While DDT.CurrentDriver.EOF=False
'do some operation
CountDDT=CountDDT+1
DDT.CloseDriver(Driver.Name)
Call WritetoExcel()
If Not DDT.DriverByName(driver.Name) is Nothing Then
Call DDT.CloseDriver(driver.Name)
else
Set Driver=DDT.ExcelDriver(filepath2,SheetName1,True)
for i=1 to CountDDT
Call DDT.CurrentDriver.Next
Next
End if
Wend
I m not sure this is the best approach