# Append text range does not exist

**URL:** <https://forum.uipath.com/t/append-text-range-does-not-exist/441639>\
**Category:** Activities\
**Tags:** datatable, question, excel, activities\
**Created:** [May 23, 2022, 4:55am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639 "2022-05-23T04:55:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 4:55am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/1 "2022-05-23T04:55:09Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [May 23, 2022, 5:02am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/2 "2022-05-23T05:02:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 5:07am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/3 "2022-05-23T05:07:13Z")

</div>

This is the screenshot.

![image](https://global.discourse-cdn.com/uipath/original/4X/5/7/f/57fe4b59d76be2a1c62c295818fc2c960845eebb.png)

Inside the for each row in DT there’s this activity :

1. Assigning SQL Query (Example : Select \* from tableX where = ‘…’)
2. Sequence Query : Execute Query from assigned sql query and outputted to data table
3. Excel process scope : Write Datatable to Excel (Value of data table is based from executed query on number 2

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [May 23, 2022, 5:12am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/4 "2022-05-23T05:12:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Palaniyappan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/palaniyappan/32/524095_2.png) [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Post date:** [May 23, 2022, 5:20am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/5 "2022-05-23T05:20:47Z")

</div>

Hi

Did we try with APPEND RANGE activity here if you are looking for appending data rows to the current file

> **[Append Range](https://docs.uipath.com/activities/docs/append-range-x)**
>
> 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

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 5:25am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/6 "2022-05-23T05:25:25Z")

</div>

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

![image](https://global.discourse-cdn.com/uipath/original/4X/f/3/c/f3c3a3b79c2cda412debe03f39424b7bc50b78ea.png)

![image](https://global.discourse-cdn.com/uipath/original/4X/2/a/d/2ad2b4d72db9bb4841e8417a99486752d70ce202.png)

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [May 23, 2022, 5:31am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/7 "2022-05-23T05:31:18Z")

</div>

@Rhys18 Ca you remove the range part in Write Datatable to Excel activity.

![image](https://global.discourse-cdn.com/uipath/original/4X/c/4/8/c48349378de133662795b8292235ea3905d40a19.png)

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 5:57am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/8 "2022-05-23T05:57:43Z")

</div>

I tried this. I am facing 2 problem right now.

1. 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?

2. I have more than 1 query, the next queries are outputted into rows and not in a record.

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [May 23, 2022, 6:20am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/9 "2022-05-23T06:20:12Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 6:54am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/10 "2022-05-23T06:54:47Z")

</div>

1. Using for each row in data table? What’s the variable I have to put “In” section?
2. 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

![image](https://global.discourse-cdn.com/uipath/original/4X/7/c/9/7c9e2bc8d467cac84e064635b6e025cf57d87b90.png)

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 6:55am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/11 "2022-05-23T06:55:27Z")

</div>

Hi @Palaniyappan

I still confuse how to use this. Can u give an example in screenshots? Thanks

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [May 23, 2022, 6:57am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/12 "2022-05-23T06:57:23Z")

</div>

@Rhys18 if you want ot finter based on customer name , then

CurrentRow(“customer\_name”).ToString

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 23, 2022, 7:05am UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/13 "2022-05-23T07:05:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rhys18](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rhys18/32/304108_2.png) [@Rhys18](https://forum.uipath.com/u/Rhys18)\
**Post date:** [May 24, 2022, 12:32pm UTC](https://forum.uipath.com/t/append-text-range-does-not-exist/441639/14 "2022-05-24T12:32:45Z")

</div>

Can any1 help me on this? I really need it urgent
