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)

excel
activities
error

#1

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


#2

Hi!
Does this help?


#3

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


#4

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


#5

Yes, for me it worked well


#6

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


#7

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


#8

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


#9

Hi,

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


#10

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


#11

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)?


#12

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:


#13

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.


#14

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


#15

Hi Dilip,

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


#16

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


#17

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


#18

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


#19

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

Thanks In advance


#20

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?