At first run of the bot report excel doesn’t contain any data in it,
For the second run onwards by seeing no of rows report file I need to write the data.
at first run of the bot getting below error.
Thanks,
At first run of the bot report excel doesn’t contain any data in it,
For the second run onwards by seeing no of rows report file I need to write the data.
at first run of the bot getting below error.
Thanks,
I guess youa re having header check…read once without it and count the rows…if it is one or no
if not read the first cell A2 and see if data is present or no
Also if excel is present or not also can be checked depending on its existance
cheers
@ManjunathReddy Remove inverted Commas from Range.
Once check your excel having no data
If there is no data in excel. The Read range workbook doesnt read the excel.
You have to remove the double quotes in the range field in read range workbook activity.
If you want to know the data is there is in excel or not.
Take a If condition
Datatable.Rows.Count>1
then
It has data
else
It doesn’t have data.
Hope it helps!!
There is no data in excel file so can you please check whether you have passed correct file or not?
Regards
This error occurs only when there is no data in excel so please check whether there is data in file or not manually and also please check the file path given.
regards
I have give correct parameter’s
Actually the excel doesn’t have any data it is purely blank sheet.
I have to handle this.
@raja.arslankhan @pravallikapaluri @lrtetala @vrdabberu @mkankatala @Anil_G
Thanks
Use Excel Activities
Then you can use the excel process scope and then ue the use excel file activities and then use the read range activity within that.
Regards
=> Use excel file activity and give the path of the excel file there.
=> Insert the Read range activity inside the Use excel file Store the output in a datatable.
=> After that use If condition to check the
datatable.rowscount>1
=> If the datatable have any rows then place the activities in the then block
=> It will go to else block when it have no rows.
Note - when using use excel file and read range excel activities it will read the excel if excel doesn’t have the data in it.
I already checked check the below workflow.
Check the above one my excel file is empty and I get the message box as below.
Note - When there is no data in the excel file, when we read that file with read range workbook it throws an error Object reference not set to an instance of an object. But Excel activities like Use Excel file and Read range don’t throw any error it will read.
Hope it helps!!
@ManjunathReddy Yes you can put Try Catch and in Catch block you can put assign activity.
yourDT=New yourDT
Hello @ManjunathReddy, May I know the Purpose of reading Blank Sheet? Do you need to create the Data table, Use the Build data table activity or Assign the Datatable variable with the New DataTable()
DT=New DataTable()
Or Else Use ReadRange activity in Try catch with system.Exception and assign the above DT in Catch
If the file exists but its completely blank…then try using read cell first on A2 and check if that has valeu and depending on that either read range or move without reading
Cheers
We encountered such a scenario when some excels were processed with the workbook activities but were on its internally strctures not conform.
For a further root cause analysis:
Is now again failling or it is read in?
In our cases we observed that the producing application were setting some internal metadata wrongly (failling with woorkbook read range). When opening it with excel the defects were edited and so it was readable for the workbook read range activity.
Kindly note: we only look for a better understanding on the root cause. Fixing / Workaround strategies will be checked in a follow-up step
Count = 1
Use if Count =1:
Then dt = new datatable()
Count = count +1
Else:
Use Read range
Get the count value from the asset and update the count value to asset by using set asset.