# Write Range: Could not write datatable to Excel

**URL:** <https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218>\
**Category:** Studio\
**Tags:** activities-panel, question, studio, excel, activities\
**Created:** [September 21, 2021, 4:27pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218 "2021-09-21T16:27:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 21, 2021, 4:27pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/1 "2021-09-21T16:27:16Z")

</div>

Hi All,

I need some help to identify what is going on with the my code.

I am having issues while writing datatable in excel tab. I have 3 write range activity in Excel Application scope. Error occurred on 3rd Write range activity. However, if I move last write range out of Excel application scope and create a new Write range Excel activity. It’s working fine.

Problem is my entire flow was working in when I last ran. Since today morning I am facing this issue.

I am writing the datatable in a worksheet which already has header on row 2 and I am writing datatable from A3. Below is the error message.

RemoteException wrapping UiPath.Excel.Excel Exception: Could not write the data table starting with cell A3. —\> RemoteException wrapping System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC

I would appreciate any help. Thanks

---

<div class="post-metadata">

**Author:** ![lakshman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lakshman/32/523490_2.png) [@lakshman](https://forum.uipath.com/u/lakshman)\
**Post date:** [September 21, 2021, 4:58pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/2 "2021-09-21T16:58:23Z")

</div>

@skg_161125

Have a look below thread.

> [@Excel - How to deal with Exception from HRESULT: 0x800A03EC](https://forum.uipath.com/t/excel-how-to-deal-with-exception-from-hresult-0x800a03ec/161137):
>
> A few workarounds to the common error code 0x800A03EC. Before you check it out, please make sure you are running the latest available stable Excel package from our Official feed. If you have encountered this error during your Excel processing, please make sure: you can access the file your are working on (in case of shared drives → the file is not open by another user) the file is not open already open in a non-standard editing mode (read-only, password-protected, etc) there is no conflictin…

---

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 21, 2021, 5:18pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/3 "2021-09-21T17:18:07Z")

</div>

Hi @lakshman

I could only think of adding some delay and validating the Excel Activity Package version.

I have added 5 sec delay between each write range activity with in one excel application scope.  
And I am using Excel Activity package version 2.10.4.

I am still facing the same error at same activity. Every other write range activity before and after that activity is working absolutely fine.

Do you think of any other possible cause of this issue?

---

<div class="post-metadata">

**Author:** ![lakshman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lakshman/32/523490_2.png) [@lakshman](https://forum.uipath.com/u/lakshman)\
**Post date:** [September 21, 2021, 5:28pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/4 "2021-09-21T17:28:54Z")

</div>

@skg_161125

It’s weird.

Can you try with Workbook activities and check it once.

---

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 21, 2021, 5:37pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/5 "2021-09-21T17:37:33Z")

</div>

Yes, If last write range activity is moved out from Excel application scope and add as Workbook Write range with same path, sheet name, range and datatable. It is working fine. But I am running a macro on the same excel after last write range, I am getting another error on Execute Macro.

But earlier, my workflow was working fine with all write range & Execute MAcro within same excel application scope.

---

<div class="post-metadata">

**Author:** ![lakshman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lakshman/32/523490_2.png) [@lakshman](https://forum.uipath.com/u/lakshman)\
**Post date:** [September 21, 2021, 5:39pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/6 "2021-09-21T17:39:09Z")

</div>

@skg_161125

Did you update **UiPath.Excel.Activities** package ?

Can you please restart the system and then check it once.

---

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 21, 2021, 5:43pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/7 "2021-09-21T17:43:15Z")

</div>

I did not update my package. I tried restarting the system and UiPath. No Luck.

---

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 22, 2021, 2:20pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/8 "2021-09-22T14:20:22Z")

</div>

Tried multiple approach, but still facing the issue with only one Excel Application Scope activity.

I have tried re-installing excel package.

I am using couple of more Excel application scope after, those activity are working fine.  
Can someone please help me? I am really stuck here.

---

<div class="post-metadata">

**Author:** ![UdayR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/udayr/32/251382_2.png) [@UdayR](https://forum.uipath.com/u/UdayR)\
**Post date:** [September 22, 2021, 2:34pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/9 "2021-09-22T14:34:49Z")

</div>

Did you try killing all running Excel processes before executing the faulted excel scope activity?

---

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 22, 2021, 2:47pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/10 "2021-09-22T14:47:34Z")

</div>

Yes, already have Kill Excel process activity in place.

I also tried moving 2nd Excel Application scope activity before the activity I am currently having issue. I didn’t face any issue.

---

<div class="post-metadata">

**Author:** ![UdayR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/udayr/32/251382_2.png) [@UdayR](https://forum.uipath.com/u/UdayR)\
**Post date:** [September 22, 2021, 2:56pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/11 "2021-09-22T14:56:38Z")

</div>

Try killing process just before the faulted activity. I had similar issue and support team told Target application not getting disposed properly was a cause for the issue.

Excel application scope → Kill → Excel application scope → kill → Excel application scope

---

<div class="post-metadata">

**Author:** ![skg\_161125](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@skg\_161125](https://forum.uipath.com/u/skg_161125)\
**Post date:** [September 22, 2021, 6:53pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/12 "2021-09-22T18:53:52Z")

</div>

Thank you for the suggestion. I tried this workaround, but still facing the issue.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [September 28, 2021, 5:32pm UTC](https://forum.uipath.com/t/write-range-could-not-write-datatable-to-excel/347218/13 "2021-09-28T17:32:53Z")

</div>

Closed on September 28, 2021, 5:32pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
