cancel
Showing results for 
Search instead for 
Did you mean: 

Error with 'copy paste worksheet' in Control Room

fgaia
Level 3
Hello, everyone!
I need to get a sheet from one Excel file and copy it to a specific range on another Excel file. The 'Copy Paste Worksheet Range' activity does that successfully but only when I'm debugging or when I'm running at my machine.
But, when I execute it on a Virtual Machine via Control Room, I get the error "Failed to Select row: select method of Range class Failed". If I open the VM and watch the process, that same error happens. 
Can anybody help me?
Thanks in advance!
1 BEST ANSWER

Best Answers

ManpreetKaur1
Level 8

Hi @Felipe Gaia,

Are you using single handle or multiple handles?

I would prefer using single handle even for handling multiple excel files. Please use the below set of activities to achieve the functionality:

1) Use Select action to select the range which needs to be copied from 1st excel.
2) Use Copy​ action to copy the range
3) Use Activate worksheet to activate the destination worksheet
4) Use Go to Cell to go to the destination cell where pasting needs to be done
5) Use Paste action to finally paste the data.

It should work. Please let me know if it doesn't work.

View answer in original post

6 REPLIES 6

Rambo27
Level 8
Hi Felipe, 

Select Method of Range class failed: This usually occurs when we try to select the cells other than the active sheet without making the sheet select or active.
Try to make active sheet and then run this activity once and check
Shikhar Mishra RPA Lead Infosys

fgaia
Level 3
Hello, @Shikhar Mishra! Thank you for the reply!
I already tried Select but it didn't work. Now I tried Activate but got the same error.
Do you have any other suggestion? Forgot to mention that both workbooks are opened, but I don't believe this is the reason why I'm getting this error.

ManpreetKaur1
Level 8

Hi @Felipe Gaia,

Are you using single handle or multiple handles?

I would prefer using single handle even for handling multiple excel files. Please use the below set of activities to achieve the functionality:

1) Use Select action to select the range which needs to be copied from 1st excel.
2) Use Copy​ action to copy the range
3) Use Activate worksheet to activate the destination worksheet
4) Use Go to Cell to go to the destination cell where pasting needs to be done
5) Use Paste action to finally paste the data.

It should work. Please let me know if it doesn't work.

Hi Filipe.

Can you try putting some delay after opening each of the workbooks using 'Sleep' action from 'Utility - General' VBO as shown below. Also, ensure that you use the 'Show' action as without this from Office 2013 onwards there are some issue that happens while using this action in the background mode:

36721.png

------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

fgaia
Level 3
Hello, @ManpreetKaur4! I'm really sorry for taking too long for a reply.
A co-worker later found out that there was an error on the object code.
But these steps that you described were the ones that I already put on the process, so I'm marking your reply as best answer so people with this problem in the future would follow it 🙂

Thanks again!

fgaia
Level 3
Hello, @devneetmohanty07!
Sorry for taking too long to reply. Thank you for the answer!
In my case a coworker found out that there was an error on the object code, we fixed it. 
And yes, the 'show' activity is very important when using 'copy paste' activity, I hope your reply can help someone having this problem in the future 🙂

Thanks again!