I am looping Excel files from a folder, but one Excel doesn’t have any kind of data in it. Bot stops there by showing exception in read range activity like - ‘Read Range Workbook: Object reference not set to an instance of an object.’.
How can i sort this issue?
Either use a try catch around
or first check by reading one cell if data is present and then read
cheers
Go with try catch or Excel Application Scope’s Read Range
Hello @ajnaraya , Usually if there is no data in the Excel file, Read range throws an error. To handle this Exception, Use Try catch Method. For more info refer to this thread.
can we consider it a business rule exception or a system exception?
Hey @ajnaraya ,
If the excel file is empty then The read range workbook activity throws an nullReference Exception
So to handle this exception , please surround your read range activity using Try Catch activity
Wrap the Read Range workbook activity like below screenshot
Hope it helps you out
Surround the Read range with try catch and supress the error in catch block as system exception.
H! @ajnaraya
You can try with this way,
in catch you can keep log messages to display ‘Excel Sheet contains no data rows’
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.