When iam reading an excel using read range activity, it shows object reference not set to an instance of an object…
My excel workbook have 5 sheets and 2 of them are empty…I have to read the empty sheet and set output as zero.
How can fix this issue.can you help me
Instead of reading the empty sheet and creating a datatable variable dt
We can use a simple assign activity like this
dt = New System.Data.Datatable
Looks like some of the variable does not holding any values so that only you are receiving "Object reference not set to an instance of an object’ error.
You have to initialize the variable does not hold any value.
Kindly ensure all inputs are correctly passed to the activity.
Use try catch activity if you get an error make it as new datatable()
Can you please share sample code/screenshot here?
Based on my experience we would get this on workbook read range if we try with empty sheets. Could you confirm whether we are using workbook read range for this requirement.
If you are using workbook read range. For work around could you use excel application scope and provide input your excel and use read range inside your excel application scope and try.
And also I could see below thread resembles your issue. Please review. Thanks.
I checked it by placing it in excel application scope. It worked out. Thanks
your welcome @Usha_Sree . Glad it worked.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.