hi this error occurs if DDT is not closed make sure u closed the ddt driver before accessing the excel driver
to close the excel driver
Call DDT.Closedriver(Driver.name)Writing data to excel sample
fileName = "<Path_To_The_File>"
Call WriteExcelSheet(fileName, sheetName)
Sub WriteExcelSheet(fname, sheetName)
Dim maxcol, maxrow, app, book, sheet, rowCount, row, col
Set app = Sys.OleObject("Excel.Application")
Set book = app.Workbooks.Open(fname)
Set sheet = book.Sheets(sheetName)
app.DisplayAlerts = False
' Write an index of the current row and column to a cell
rowCount = sheet.UsedRange.Rows.Count + 1
For row = rowCount To rowCount + maxrow - 1
sheet.Cells(row, col) = row & ", " & col