In one sequence, I am using an Excel Application scope to open an excel file, assign a handful of variables, then close the workbook.
In the next separate sequence, I use “Use Excel File” with “Excel For Each Row” to iterate on the specified worksheet. Once it gets to a “Write Cell” dialogue, it throws the subject error:
“Write Cell: COM object that has been separated from its underlying RCW cannot be used”
I’ve combing through the forum and tried many things but am at a loss.
if you can use Modern Excel activities : ExcelProcessScope anf UseExcelFile, it’s better to use them.
More specific, put ExcelProcessScope outside the loop and put UseExcelFile inside the loop, as the following.
I accidentally found a way to make this work. I only included the “Read Range” activity within the “Excel Application Scope” which created the data table needed to get dt.RowCount.
Once I assigned the other variables, the Use Excel File activity worked just fine.