# Write Range - Issue

**URL:** <https://forum.uipath.com/t/write-range-issue/215811>\
**Category:** Studio\
**Tags:** excel, activities\
**Created:** [April 23, 2020, 11:58am UTC](https://forum.uipath.com/t/write-range-issue/215811 "2020-04-23T11:58:20Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 23, 2020, 11:58am UTC](https://forum.uipath.com/t/write-range-issue/215811/1 "2020-04-23T11:58:20Z")

</div>

Hi everyone,

I try to used a write range activity, I made a simple extract from a web page and got this error, the file is created, “Feuil1” is correctly spelled…

Thanks

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

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 23, 2020, 12:00pm UTC](https://forum.uipath.com/t/write-range-issue/215811/2 "2020-04-23T12:00:22Z")

</div>

Check DTenjeux variable scope

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 23, 2020, 12:03pm UTC](https://forum.uipath.com/t/write-range-issue/215811/3 "2020-04-23T12:03:15Z")

</div>

Done

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 23, 2020, 12:04pm UTC](https://forum.uipath.com/t/write-range-issue/215811/4 "2020-04-23T12:04:01Z")

</div>

Do you mean that the problem is solved?

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 23, 2020, 12:06pm UTC](https://forum.uipath.com/t/write-range-issue/215811/5 "2020-04-23T12:06:46Z")

</div>

Sorry no, I mean i already checked that.

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 23, 2020, 12:08pm UTC](https://forum.uipath.com/t/write-range-issue/215811/6 "2020-04-23T12:08:37Z")

</div>

This kind of erreur is shown when a variable is not initialised. The only variable I see is this one. (and I should have noticed that you have the datatable schema in the debug window)

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 23, 2020, 12:11pm UTC](https://forum.uipath.com/t/write-range-issue/215811/7 "2020-04-23T12:11:50Z")

</div>

I put New System.Data.DataTable for this variable and still the same problem  
It"s weird because it’s been a years that i’m using this activity without issues

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 23, 2020, 12:14pm UTC](https://forum.uipath.com/t/write-range-issue/215811/8 "2020-04-23T12:14:55Z")

</div>

I see in the screenshot that the datatable has its schema set. The problem is probably not there. The only other variable I can think about in a WriteRange activity (workbook flavor) is Password.

Could you please copy the text inside $ExceptionDetails, please?

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 23, 2020, 12:47pm UTC](https://forum.uipath.com/t/write-range-issue/215811/9 "2020-04-23T12:47:17Z")

</div>

19.10.4+Branch.support-v2019.10.Sha.fe819a658cad0585a64d2f8af94fad5c30b8d122

Source : Write Range

Message : La référence d’objet n’est pas définie à une instance d’un objet.

Type d’exception : System.NullReferenceException

RemoteException wrapping System.NullReferenceException: La référence d’objet n’est pas définie à une instance d’un objet.  
à UiPath.Excel.Activities.WorkbookActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)  
à System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)  
à System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 23, 2020, 12:48pm UTC](https://forum.uipath.com/t/write-range-issue/215811/10 "2020-04-23T12:48:11Z")

</div>

et les paramètres du WriteRange ?

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 23, 2020, 12:56pm UTC](https://forum.uipath.com/t/write-range-issue/215811/12 "2020-04-23T12:56:02Z")

</div>

RemoteException wrapping System.NullReferenceException: La référence d’objet n’est pas définie à une instance d’un objet.  
à UiPath.Excel.Activities.WorkbookActivity`1.EndExecute(AsyncCodeActivityContext context,  
IAsyncResult result)  
à System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,  
IAsyncResult result)  
à System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,  
BookmarkManager bookmarkManager)

“Name”: “Write Range”,  
“Id”: “1.43”,  
“InstanceId”: “30”,  
“TypeName”: “UiPath.Excel.Activities.WriteRange”

 ![image](https://global.discourse-cdn.com/uipath/original/3X/9/4/940b68c5766125cccbb929ae73a775f6a50ae234.png)

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 23, 2020, 12:58pm UTC](https://forum.uipath.com/t/write-range-issue/215811/13 "2020-04-23T12:58:40Z")

</div>

Just for experimenting, could you please check “AddHeaders”?

EDIT: By the way, in your two screenshots the StartingCell are different.

---

<div class="post-metadata">

**Author:** ![gulshiyaa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gulshiyaa/32/149223_2.png) [@gulshiyaa](https://forum.uipath.com/u/gulshiyaa)\
**Post date:** [April 23, 2020, 2:28pm UTC](https://forum.uipath.com/t/write-range-issue/215811/14 "2020-04-23T14:28:34Z")

</div>

Hi @Pierre_PARIS,

Are you Using any Excel application Scope?  
If Your Using any excel applicaton Scope Place the Write Range Out Side Of the Sequence Or If you Not using any application Scope Remove the Extract structure data variable and again create a new variable and pass it and keep the write range inside the do And keep your Starting cell empty “” like this and enable the add headers

regards,  
Gulshiyaa

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 24, 2020, 8:58am UTC](https://forum.uipath.com/t/write-range-issue/215811/16 "2020-04-24T08:58:18Z")

</div>

The excel application scope in not working on my PC, it says that Excel is not install  
This is why I use the other write range activity

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 24, 2020, 8:59am UTC](https://forum.uipath.com/t/write-range-issue/215811/17 "2020-04-24T08:59:48Z")

</div>

After multiple test, If i create a simple Excel file, It works but it is not working while i’m using a other file, in which there is already formula and data inside.

It a problem of excel file, there is some restrictions ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![gulshiyaa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gulshiyaa/32/149223_2.png) [@gulshiyaa](https://forum.uipath.com/u/gulshiyaa)\
**Post date:** [April 25, 2020, 1:52am UTC](https://forum.uipath.com/t/write-range-issue/215811/18 "2020-04-25T01:52:26Z")

</div>

Hi @Pierre_PARIS

If you dont have excel application on your system it will not work.Install excel and enable in your uipath studio then work

regards,  
gulshiyaa

---

<div class="post-metadata">

**Author:** ![Pierre\_PARIS](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pierre_paris/32/98239_2.png) [@Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)\
**Post date:** [April 25, 2020, 7:18am UTC](https://forum.uipath.com/t/write-range-issue/215811/19 "2020-04-25T07:18:12Z")

</div>

I pretty sure that there is 2 type of “write range” activity.  
One working inside an excel application scope and the second one working alone.

Again it works on a different excel file so it’s should be link to the excel file itself.

---

<div class="post-metadata">

**Author:** ![msan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/msan/32/110167_2.png) [@msan](https://forum.uipath.com/u/msan)\
**Post date:** [April 25, 2020, 2:27pm UTC](https://forum.uipath.com/t/write-range-issue/215811/20 "2020-04-25T14:27:31Z")

</div>

Indeed, WriteRange activity have an “Excel” and “Workbook” flavor, that latter doesn’t require an excel scope (that’s why I use it) and AFAI doesn’t require you to have Excel in your system.

I doubt that the error message as shown in the opening post is related to the output file by itself. Could you place just before your WriteRange activity two other activities?

- OutputDataTable
- LogMessage (with the previous output)

If after your changes you introduced new variables or if your error message is different, please attach updated informations.

---

<div class="post-metadata">

**Author:** ![AaronMark](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@AaronMark](https://forum.uipath.com/u/AaronMark)\
**Post date:** [August 5, 2022, 9:23pm UTC](https://forum.uipath.com/t/write-range-issue/215811/21 "2022-08-05T21:23:19Z")

</div>

HI [Pierre\_PARIS](https://forum.uipath.com/u/Pierre_PARIS)  
for a few days, I have been in the same problem as you.  
Same dynamic.  
Automation, in production for more than a year. Always everything ok.  
The Write Range has failed for a few weeks, without Application Scope.  
I also have no office on my VMs.  
You solved? how?
