Excel is duplicated by the robots while being opened

Hello,

When I use the Excel Application Scope activity and the Append range activity, if this Excel file is opened, then the data is pasted in a new Excel file created by UiPath.

The original file name is: FILE
The name that has the new file is: FILE (1)

Is there any way to avoid this?

If the Excel file is opened while the robot is running, I do not want the robot to create a duplicated file.

Thanks in advance.

Strange :thinking:

Can you share the workflow?

It is not anything rare. I just use Excel Application Scope and while executing the robot i have it opened and then the robot creates a new file called “File (2)”

What should be the performance?

@EngAnalyst

Hey,

  1. If you are working on existing file, make sure to uncheck createNewFile.
  2. If you want to create a excel file from Excel Application Scope, Makes sure you check create new file.

Note:- In any case do not open excel file while bot is running.

1 Like

Hi @EngAnalyst,

Append Range -
Adds the information stored in a DataTable variable to the end of a specified Excel spreadsheet. If the sheet does not exist, a new one is created with the name indicated in the SheetName field.

Can you please verify the path of the excel used in append Range using an writeline and verify the excel path.


Mukesh

1 Like

Ideally it will not create new file even if the file is open
If you use Excel Application it will work fine even after you keep open the file—It will create only when the path file is not available/present (Check whether path is right or not))
For workbook it will throw error that file is being used by another process
But it will not create another file

1 Like

I’m having exactly the same issue as you with the robot creating the same file with (1), (2), etc at the end

Did you find a solution? All I can think of is to get the robot to find any duplicate files and delete them at the end, but this feels inefficient

can you share workflow

It’s just an excel application scope with an append range in it. This is surrounded in a try catch to see if the sheet is locked. This is in a while loop which will retry the process until the file is not locked and the original can be saved.

The issue occurs where the file is locked, it loops correctly, but like the OP says, creates duplicate files with (1).xlsx, (2).xlsx etc

is duplication is only for Password protected file