UiPath throws an error with exit code 255 when handling Excel file

excel

#1

Hi, I’m new to UiPath, and I’m trying to select cells which contain a key word from an Excel file, by using “Excel application scope”, “Read Range”, “For each row” , “Get row item” and some other activities.

It works fine when Excel file only contains 10 rows, but it doesn’t work when the file contains 4000+ rows (323KB); UiPath Robot stop working when I click on “Run”, and display exception message with exit code “255”, but no relevant log on log files.

What should I do for this error?

EDIT
I noticed that it works fine when I add more rows to the excel file. There might be a bug of .Net or something.


#2

Hello @a-taniya

Exit code 255 sounds like a .NET exception within the tool (target application) you’re running. You’ll not be able to catch this exception in your code

Try to run it in debug mode and then tell what you are getting?

Regards…!!
Aksh


#3

Thank you for your quick response!

I tried to run it in debug mode, and now I know it stops working on “Read Range” activity, but there’re information messages only…


#4

Can you share your workflow and that excel file?


#5

I modified my excel file a bit because it contains some personal information so I cannot upload the file as it is, and surprisingly my workflow worked!

However, I’m confused because it worked when I changed data in a certain cell but it also worked when I keep the cell as it is and changed another cell instead.

In addition, it’s not applicable all the cells; it works when I remove data from “O32” or “A4300:A4305”, but it won’t work when I remove data from “B3”, for example.

Since I cannot upload excel file as it is but it works well when I modify only a cell of it, it seems difficult to investigate my case :frowning:


#6

Hi,

Recently i have created a custom activity for large csv file.
This activity will spit the files into multiple file with 300 lines in each so that UiPath activities can read it.
Output will be the count of the files… and it will append number to each spitted file.
It is working good for csv and text files … can you check for excel too.
Hope it will solve your issue.

URL: https://github.com/palindromeguy/UiPath/blob/master/SplitFile.Activities.1.0.0.nupkg


#7

Thanks, I tried it and it seemed that the excel file was split, however, I cannot open the file because the file seems to be collapsed. I maybe need to tweak it so that it can be applied to excel files.

By the way, after some further investigation, I do believe the cause of the error isn’t the size of the file.
I added some data to excel file with which UiPath stops working, and then the UiPath worked fine with the file even I didn’t change any existing data.

I’ll try to find regularity.


#8

It turned out that the Last Cell of the Excel file (you can find it by using Ctrl + End) was on “O1048576”, because there’s unnecessary ruled lines under line number 1048576.

And, I didn’t set range in Read Range activity.

Therefore, UiPath tries to get all the data from line 1 to line 1058576 and I guess it caused OutOfMemory exception (it maybe exceeded maximum memory size of .NET process)

With other Excel files I was able to cause the same error by setting range to “A:P” or “D:U”, for example.