Error: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized)

Hi there,

I used data scraping to extract from a website a table of data.
After which, used excel application scope to create a new excel sheet called Dcon.xlsx, and write range to copy the data into the excel.

However, i keep getting an error: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized)

I;m not sure why this is happening and have tried to search online for a solution however to no avail.
Can anyone assist?

Thank You!
Kim

4 Likes

Hi!
Does this help?

4 Likes

Hi Ovi,

I don’t quite get it.
Have attached a screenshot of the error that I got, as well as the sequence I used.
Does this mean for the variable ExtractDataTable, I will have to assign a default value?

Thanks!

Capture3

Capture1

Hi,
Could you please upload workflow .
Please update excel activity if available from package manager pane.

Yes, for me it worked well

1 Like

Hi ddpadil,

Unfortunately, the website that I am extracting data from is a private site unique to my company only.
As such, I am unable to send the workflow.

I have tried to run the robot a few times, sometimes it is successful, sometimes I gives me the above error.

I did not change any coding, thus I am perplexed as to why it doesn’t work all the time.

Is there something wrong with my settings/excel?

Thanks and Rgds,
Kim

Hi,
Error thrown by the write range activity.
Hope you updated excel activity .

2 Likes

Hi ddpadil,

Noted on your suggestion, will try it out.

Able to guide me where do I find the package manager pane in the interface?
I can’t locate the Manage Package in the top panels.

Thanks!
Kim

Hi,

  • Either hit Ctl+p or click on right corner tab of activity pan as show below.
  • click on updates

2 Likes

Thanks ddpadil!!

I have updated accordingly, and tested the workflow multiple times without errors.

Will let you know if I encounter the issue again :slight_smile:

Many thanks for your help!
Kim

Hi ddpadil,

Unfortunately, I encountered the same errors again today…
I did not change anything in the workflow, yet the same error pops up sometimes.

I checked for package updates, however everything is up to date.

Any idea if it has something to do with my excel version (2013) / studio version (free trial)?

I don’t think its something to do with excel or studio version .
Can you try with other excel file.
If still the same then download new version 2017 moonlight from uipath site .:blush:

1 Like

My requirement is Name have to divide as First name, Last name and Middle name based on space. I have done split string it was divided and assigned to 3 variables. But some time I didn’t have all 3 names and if one name is null it is throwing an error.

After dividing I am passing to another task these 3 values.

1 Like

Could you please upload workflow .
It’s taking null that’s all .
Try with generic value or convert.string()

2 Likes

Hi Dilip,

I have a small query on XMLReading. How to read author,price from attached xml for each book.

1 Like

hi @ovi @vvaidya @Dominic

got the same error ,while iam using type into activity. i have read cell from excel and trying to write into a combo box using type into.please help me solving the isssue
image

@vslp_uipc, Check if the value read from the cell [excel] is nullORempty ?

1 Like

I too was scraping data from a website, i too get this error, after doing some troubleshooting, i found the default value of ExtractDataTable Variable was behind this issue, i removed the default value and it worked like butter :sunglasses:

See the attached image

3 Likes

hi,
even i am facing the same issue , have you resolved it. If yes could you please provide the solution.

Thanks In advance

Hi all, I have this error : “Object reference not set to an instance of an object” when I try to write the data table in an excel file, so write range activity throw this exception, anyone have the issue please?

1 Like