Help Needed: SQL Query Export Issue with 'Write Range Workbook' Activity

I’m currently facing an issue with a SQL query that I’m using to export information from an Excel spreadsheet into a datatable. The problem is that the query is supposed to generate two columns in the datatable, but when I use it with the “Write Range Workbook” activity, it only generates the column headers for both columns and leaves the extracted information for only one column but not the second one. I’m looking for assistance on how to make it fill out the second column as well.

I’m confident that the SQL query is correct because I previously used it in Automation Anywhere, where I performed a database read action and successfully exported the results to a .csv file. In that case, I didn’t need a secondary action; everything was seamlessly integrated into a single action within AA using the Database Read From action.

Any help or suggestions on how to resolve this issue with the “Write Range Workbook” activity would be greatly appreciated!

If you have Excel installed could you try to use the Excel Application Scope and the “Write Range” activity within the “Excel Application Scope”. Maybe it can handle the data better.

Are you using Studio or StudioX?


To isolate cause, can you try to check the datatable is same with what you expect as the following step?

  1. Set Breakpoint at WriteRangeWorkbook
  2. Run debug mode
  3. Workflow will stop, then check content of the datatable at Locals panel (top-left area)

If it’s no problem, it’s WriteRange matter.
If it’s not same with your expectation, it may be SQL matter etc.