Rhys18
(Rizky Albert Hartono)
May 23, 2022, 4:55am
1
Hi,
I’m using write data table to excel. I’m using For each Row in Data Table and I’m using query inside the loop. If I didn’t append, the excel keep opening and replacing the value, if I check the append, it’s showing error “Range A:B Does not exist”, Create file if not exist is also checked. Any help on this? Thank !
Hello @Rhys18 ,
Could you please share the screenshot of the flow which you have created?
Also the excel to which you are trying to append.
Rhys18
(Rizky Albert Hartono)
May 23, 2022, 5:07am
3
This is the screenshot.
Inside the for each row in DT there’s this activity :
Assigning SQL Query (Example : Select * from tableX where = ‘…’)
Sequence Query : Execute Query from assigned sql query and outputted to data table
Excel process scope : Write Datatable to Excel (Value of data table is based from executed query on number 2
Hello @Rhys18
In the Write Datatable to Excel activity, whats the Range that you have provided?
Or just provided the Sheet name?
Will it be possible to share the flow here?
Hi
Did we try with APPEND RANGE activity here if you are looking for appending data rows to the current file
UiPath.Excel.Activities.Business.AppendRangeXCopies the data in a table, range, or sheet and pastes it after existing data in another specified table, range, or sheet. The activity can be used with Excel files selected for parent Use Excel File...
That is process all the data first and then next to for each row use this append range activity
Cheers @Rhys18
Rhys18
(Rizky Albert Hartono)
May 23, 2022, 5:25am
6
It’s not possible to share the flow because there’s credentials in it. But I will show u the screenshot of the write data table
@Rhys18 Ca you remove the range part in Write Datatable to Excel activity.
Rhys18
(Rizky Albert Hartono)
May 23, 2022, 5:57am
8
I tried this. I am facing 2 problem right now.
The excel keep open and close and write the data. Any solution how to make the excel stop closing and open to write the data?
I have more than 1 query, the next queries are outputted into rows and not in a record.
@Rhys18
for point 1: you can use For each datarow loop into excel scope. Currenlty for each datarow Excel scope is opening.
Point 2 is not clear. Can you give more insights to it.
Rhys18
(Rizky Albert Hartono)
May 23, 2022, 6:54am
10
Using for each row in data table? What’s the variable I have to put “In” section?
I have 2 query
query 1 : Select Customer_number, phone_number from etc
query 2 : select customer_address
without range the output will be like this in the excel
Rhys18
(Rizky Albert Hartono)
May 23, 2022, 6:55am
11
Hi @Palaniyappan
I still confuse how to use this. Can u give an example in screenshots? Thanks
@Rhys18 if you want ot finter based on customer name , then
CurrentRow(“customer_name”).ToString
Rhys18
(Rizky Albert Hartono)
May 23, 2022, 7:05am
13
It’s done filtered. Now what should I do to make the excel stop close and open to write data table? I tried to use append range from palaniyappan solution but somehow it’s just replacing over and over
Rhys18
(Rizky Albert Hartono)
May 24, 2022, 12:32pm
14
Can any1 help me on this? I really need it urgent