cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to paste from clipboard: PasteSpecial method of Range class failed

Soumya21
Level 6
Hi

I am trying to use MS Excel VBO Actions to select, copy and paste while pasting I am getting the Failed to paste from clipboard: PasteSpecial method of Range class failed. When I am executing in debug mode its working fine but while executing in control room it is throwing the above error sometimes
I have used actions Activate worksheet, Select, Copy, Go to Cell, Paste.
I am also getting RPC error. Can anyone explain the reason behind RPC error and solution
Kindly please let me know any solutions for this.



------------------------------
Soumya kalal RPA Developer
------------------------------
15 REPLIES 15

ewilson
Staff
Staff
@Soumya21,

Is there existing data in any of the cells of the range you're trying to paste over?

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @Soumya21

As @ewilson has suggested it could be there is data there already which is causing the failure. As for the RPC error I've found this is usually a result of trying to perform an action before the previous action has completed. I've seen this in both excel and outlook, generally the code actions arent released until the action is complete but for some actions they can be a little slow. I would suggest maybe adding in a small sleep action or if its always on the same action you are seeing this error then try catching the error, sleeping for maybe 30 seconds then retry the action.​​

------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

@ewilson

Yes, I am trying to copy and paste formula as values and bot throwing error even if there is no values in the cell range

Thanks.
Soumya​



------------------------------
Soumya kalal RPA Developer
------------------------------

Hi @Michael ONeil

Thanks for the reply, 

We have implemented this, but we are not sure where exactly this occur, it is occurring in all the pages where MS excel VBO is used, and we have retried by keeping sleep 
Is there any other solution for this.

thanks
soumya


------------------------------
Soumya kalal RPA Developer
------------------------------

ewilson
Staff
Staff
@Soumya21,

I think it might be best if you can paste some screenshots to let us see how you've configured things. I've run a quick test, but I'm not seeing the issue you're having. Here's the test spreadsheet I threw together and the simple test process.

24007.png
24008.png
24009.png
I was able to copy the range A1:A4 into the same workbook and worksheet as range B1:B4. I was also able to copy the formula in C5 over to D5.

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

@ewilson
Thanks for the reply
I am applying one excel formula and I am doing drag and drop after that I am copying and pasting that data in that column only as values, I am using actions Select, copy, go to cell, paste.
when in debug mode it's not throwing any error when in control room its throwing error.

------------------------------
Soumya kalal RPA Developer
------------------------------

Hi @Soumya21,

Apologies for the delayed response. Are you still dealing with this?

Cheers,​

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson

Thanks for the reply. As of now I have added retry logic for that error because when this error comes if I give rerun it will work. So, I added logic to retry
It would be better if you suggest any other idea to solve this issue.

Thanks,
Soumya

------------------------------
Soumya k RPA Developer
RPA Developer
Qualesce India Private Limited
Bangalore
------------------------------

@Soumya21,

Just to be clear are the copy/paste issues only seen when you encounter the RPC error? What is the actual RPC error message?

Generally, there's not a lot that can be done with regards to RPC errors when trying to automate Office applications. This comes down to simple issues between managed applications (i.e. Blue Prism) and legacy COM-based applications (i.e. Excel). The common theme I've seen for addressing this, in various support forums and Stack Overflow), are to do exactly what you are doing. Catch the exception and retry. 🙁

With that said, you might want to take a look at Microsoft's Graph API. This gives you a REST API for dealing with some Office apps (excluding Word at this time). The main catch to Graph is that you have to be dealing with files stored in the Azure cloud (ex. OneDrive or SharePoint).

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------