ExcelException: The Paste operation failed. Check if excel allows the paste action with the type of range provided

I have an issue with an append range action.

I want to copy one sheet from one excel file (I will refer to this file as “old excel file” in this question) to another excel file (“new excel file”).

In order to do this, I used an:

  1. Excel process scope activity
  2. In it I have Use Excel file activity, where the excel file is the new excel file and I have “save changes” and “create if not exists” selected as true. Read formatting is “Same as project”.
  3. In the Use Excel activity I have “For each Excel Sheet” activity, from which I get “NewSheet” variable.
  4. In it I have Append Range activity, which is where the issue occurred. Here is some information about the Append Range activity:
  • Excel range to append is the sheet from the old excel file “OldSheet” (WorksheetQuickHandle variable), that is passed as an argument in the workflow.

  • Append after range is NewSheet

  • What to copy is set to All.

  • Exclude headers and Transpose are left as false (not selected).

This worked like a charm while testing it with different sheets with different content.

An issue only occurred once, for one specific sheet. The bot created the new excel file with no issue, but an exception occurred in the “Append Range” action and the excel file was left blank. The exception that happened is:

UiPath.Excel.ExcelException: The Paste operation failed. Check if excel allows the paste action with the type of range provided.

I tested the process with the same exact sheet that failed and the second time no issues occurred, which is what made this issue particularly confusing. All other sheets were copied just fine as well.

Has anyone dealt with a similar issue and what can I do to make sure it never happens again?

Since the action was successful the next time, I suppose there shouldn’t be any issue with your code. I could think of 2 possible reasons for the error -

  1. The previous sheet had quite a lot of data and so the previous append range was still in progress which could have thrown of the next append range activity
  2. This could just be an Excel issue which occured mid-operation

For either reason, I suppose placing the Append Range activity inside a Retry Scope with 1 or 2 retries and a short delay between each retry should take care of your issue


Hello @M_Kr

Can you share the screenshot of the workflow which you have created and the properties which you have set for the Append range activity?