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.
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)”
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.
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
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