Problems with 'Use Excel File' activity

Hello, my name is Arthur and I am facing a problem with the ‘Use Excel File’ activity: when i use it in my project, I would like that it creates a new Excel file, and this happens. However, after creating it, I can’t access the ‘Do’ sequence inside it. How could I do this? This is the only case that I use this activity to create a new Excel file, because I need it. Are there other ways to do this file creation?

Hello @Arthur_Ribeiro_Henrique,

You can’t just create a blank Excel file and open it directly in Use Excel File — it must contain at least one sheet or structure.

  • Simplest way: directly use Use Excel File → Write Cell/Range inside its Do block.
  • Best practice for reliability: Create File → Initialize Sheet → Use Excel File.

Understood! In this way, there is an activity called ‘Create File’ in UiPath, correct? I will try to do the best practice option.

Hello @Arthur_Ribeiro_Henrique,

Yes right, you can use Best practice for reliability

@Arthur_Ribeiro_Henrique

When you say it does not go to do ..is it getting stuck?

Ideally in most cases for excel we use a template in plce and use that as base file always..this has advantages like ..you can add some columns or custom. Formatting as well before hand and use

Alaso if only blank is needed then use excel file should auffice unless there is some issue with how uou implemented

Cheers

Hi @Arthur_Ribeiro_Henrique

Could you try to create a Log Message within your Do block just to troubleshoot?
If you check off the property Create if not exists then the Use Excel File will work for scenarios where the file is there and where it is not.

Regards
Soren

Hello, how are you @SorenB? I already tried this, and, right now, I am trying with the activity ‘File Exists’, to check if the file is really created. However, I didn’t have success, but I will continue to try! Thanks for the help!

Okay sounds good.
If you still run into problems then consider sharing your workflow .xaml-files here, so that we can take a look.

Hello, people. Sorry to not answer all of you, but thanks for all the help! I think that the problem was the extension of the file. I changed to .xls and, after accessing the created file, I will change it to .xlsx. However, now, I have another problem: is saying that, when I try to use the Exce activity, that the RPC server is unavailable. I tried to change the DNS and restart the computer. But, I didn’t have success. What do you think it could be in this case?

Messing with the file extensions like that is a bad idea.

An .xls is the binary format from 30 years ago, and was replaced by Microsoft in 2007 with the XML format and files with that format have the extension of .xlsx

You cannot just swap the file extension like that without causing some issues, these days alot of Excel security can actually refuse to work with the file if the extension doesnt match the format since its a security risk.

I think you need to go back one step, and explain how your code gets ‘stuck on the do’, perhaps share some screenshots for context as Soren did?

Hello @Jon_Smith . Thanks for the recommendation! Yeah, in this moment I can’t take screenshots because I just can’t access the activity due the RPC server error I commented before. However, the error that was appearing when I was creating the file, and the file was really created, because I checked it, was the error (in my words): “The file may be corrupted or need an extra level of permission to access it.”.

I’m abit confused. A RPC server error is stopping you from taking a screenshot of your UiPath Workflow…?

If so that sounds like a very different topic than the use Excel file activity.

From you description of the error it could sound like you are running the workflow.
Could you just grab a screenshot of the activities/design so that we can see how you have put it together?

To troubleshoot the error mentioned, you could try and experiment with these settings on your Excel Process Scope container.

Hello, @SorenB and everybody! I solved here the error! I am using the workbook suite of activities! Thanks for all the help!

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