# Write csv : object reference not set to an instance object

**URL:** <https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856>\
**Category:** Help\
**Tags:** excel, activities\
**Created:** [August 25, 2019, 12:33pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856 "2019-08-25T12:33:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfir](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kfir](https://forum.uipath.com/u/kfir)\
**Post date:** [August 25, 2019, 12:33pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/1 "2019-08-25T12:33:09Z")

</div>

Hi everyone,  
i build a sequence which data scraping from website (fincial report) by url and put it into csv file.  
but when i put the option to the next selector (multiple pages) when it comes to the write csv is  
display this error on the topic and i dont know what to do.

thanks for the helpers:)

---

<div class="post-metadata">

**Author:** ![kfir](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kfir](https://forum.uipath.com/u/kfir)\
**Post date:** [August 25, 2019, 12:33pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/2 "2019-08-25T12:33:42Z")

</div>

[Sequence3.xaml](https://forum.uipath.com/uploads/short-url/uopD4piBg7MVtvMxMYtQRbkp2oV.xaml) (8.7 KB)

---

<div class="post-metadata">

**Author:** ![AshwinS2](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashwins2/32/176686_2.png) [@AshwinS2](https://forum.uipath.com/u/AshwinS2)\
**Post date:** [August 25, 2019, 1:07pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/3 "2019-08-25T13:07:54Z")

</div>

Hi @kfir

can you tell me the site you are extracting?

Thanks  
Ashwin S

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [August 25, 2019, 1:27pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/4 "2019-08-25T13:27:19Z")

</div>

It may be due to the selector issue @kfir … the selector is for the first page and it may change for the second. So try giving it dynamic

---

<div class="post-metadata">

**Author:** ![Lahiru.Fernando](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lahiru.fernando/32/523857_2.png) [@Lahiru.Fernando](https://forum.uipath.com/u/Lahiru.Fernando)\
**Post date:** [August 25, 2019, 3:18pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/5 "2019-08-25T15:18:03Z")

</div>

Hi @kfir

Based in your title, it seems that write csv is the activity that throws the error. Am I right? If not, what’s the activity that throws the error?

If this is the write csv activity as shown in the title here, then most probably the problem is with your datatable. For some reason it may not be having data and it may be null when you try to do the write. So check whether it has any values by the time it executes that activity. If it does not, then check the places it is getting assigned. Arguments and data scraping activities

---

<div class="post-metadata">

**Author:** ![kfir](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kfir](https://forum.uipath.com/u/kfir)\
**Post date:** [August 26, 2019, 8:07am UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/6 "2019-08-26T08:07:38Z")

</div>

Hi Lahiru,

Thanks for the quick respond , when I don’t have next selector the sequence works but when I add next selector (I check and he is valid)

It seem to stack and write this error , do you have an idea for that?

Thanks a lot  
J

---

<div class="post-metadata">

**Author:** ![Lahiru.Fernando](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lahiru.fernando/32/523857_2.png) [@Lahiru.Fernando](https://forum.uipath.com/u/Lahiru.Fernando)\
**Post date:** [August 26, 2019, 8:18am UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/7 "2019-08-26T08:18:42Z")

</div>

Hi guys

@HareeshMR @AshwinS2

Will you guys be able to help @kfir. I’m unable to take a look at his xaml and respond based on this comment as I’m in hospital for past few days as my wife is not well… I’m only online via my mobile… 🤕

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [August 26, 2019, 9:06am UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/8 "2019-08-26T09:06:48Z")

</div>

@kfir

I don’t understand what are you trying to do in the workflow as it is designed in someother language. Can you please explain?

---

<div class="post-metadata">

**Author:** ![kfir](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kfir](https://forum.uipath.com/u/kfir)\
**Post date:** [August 26, 2019, 12:12pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/9 "2019-08-26T12:12:48Z")

</div>

Hi I think I fixed the problem.

Maybe you know what I need to write at the manage packages to find the pdf extension (pdf to text and pdf to excel)?

Thank you very much  
J

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [August 26, 2019, 12:32pm UTC](https://forum.uipath.com/t/write-csv-object-reference-not-set-to-an-instance-object/144856/10 "2019-08-26T12:32:48Z")

</div>

@kfir

This is the activity available to convert PDF to excel

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