Hey all. I have this group of validations to run and they all have try catches to them. If it catches any errors, it writes them to a data table and writes that data table to an Excel file. This is causing many issues.
whenever I use append range. 1. it always adds all the headers to each new error which I would like to remove. Is there a way I can write range (so it adds headers for the first one) and then use append for the others? I might not have described it well but I could use some help
Put a breakpoint on the Append Range activity then run in Debug. When it pauses, click the pencil next to the dataRow_toAppend variable, and show us what’s in the datatable.
Also, what’s the point of the Output Data Table? That’s not necessary.
That’s because you’re appending and it expects headers to already be there. You’ll need to set up your logic so that if it’s the first time you’re writing to the Excel file (can be done with File Exists) it uses Write Range with headers, and if it’s not the first time you use Append Range.
Yes i figured this might solve that. Would I just simply read the excel file and check if data row 0 is empty and write range for that one and for ELSE: append range?