Skip "Object reference not set to an instance of an object"

Hallo guys!

Any option to skip the Erros: “Object reference not set to an instance of an object” and go on with the next activitie? The values are often blank. The Excel cell should then simply remain empty.

Thanks, Nicolai

@Nicolai

Welcome to our UiPath community.

Can you set ContinueOnError to True if activity has option to skip that activity or enclose that activity in Try Catch block to continue with next activities it throws any error.

Hey, thank you!

I have now added the execution to TryCatch. It no longer gives me errors, but if the value is empty, the following actions are no longer executed.


The Try/Catch should go around everything including the Use Excel file.

But really, what you should do is use an IF to see if there is a value. If there is, do the Use Excel File steps. If there’s no value, do something else (or nothing).

@Nicolai

You should keep each activity into separate Try Catch block.

No no no. That’s not how Try/Catch should be used. Very messy.

A simple IF to check the value before trying to use the value is all that’s needed.

1 Like

@postwick

Sorry it’s my bad. I thought he is getting error at range.

@Nicolai

Try below expression in IF activity to check whether string value is null or not.

          String.IsNullOrEmpty(varStringValue.Trim)

Thank you @lakshman @postwick for the approuches! :heart:

I was able to solve it now with the .any function. Here is my whole workflow (PDF to EXCEL):

Hi @Nicolai ,

If you were able to fix the issue, Please mark the Post which was the most appropriate in Solving the issue.

By doing so, the Method used might be able to help others from this post.

You could also post the Solution yourself.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.