Topic Thread

Expand all | Collapse all

Error Pastespecial in range Values

  • 1.  Error Pastespecial in range Values

    Posted 06-30-2020 15:07
    Hello, Everyone.

    I recently had a problem with copy and paste values.

    I try to explain in detail:

    I'm automating some processes that are done through excel. Mainly, the sheets are populated through VLOOKUP:
    1. Insert a formula in the right cell (ex. A1)
    2. Find the next empty, starting from cell "A1" -> output will use for range class (ex.  "row output"). I used this action because the range isn't always the same.
    3. Extend formula from A1+1 to A("row output -1)
    4. After this, I remove the formula and I take values. I use copy and paste values (ex. source value("A1"), destination A("row output -1))

    Frequently I have this error:

    "Copy and Paste Worksheet Range Values: Failed to copy worksheet: Error in PasteSpecial method for range class".

    In addition, I have this kind of problem when I run the process through control room. If I start the process in debug works 100%.

    Can someone help me?

    Thanks in advance,


    Matteo Pavone

  • 2.  RE: Error Pastespecial in range Values

    Posted 07-01-2020 14:29
    Can you determine on which stage specifically the error is occurring?

    Would you be able to share any of the workflow and an example excel sheet?

    It is curious that this is only happening via control room. Are you using the same resource for both debug and when you're running it via control room?

    Nicholas Zejdlik
    RPA Developer

  • 3.  RE: Error Pastespecial in range Values

    Posted 28 days ago
    Edited by Matteo Pavone 8 days ago
    Hi Nicholas,

    Thanks for the answer.
    The workflow is:

    1. SET CELL VALUE in "C2" -> "=IF(ISNA(VLOOKUP(A4,'["&[Macro Pivot.Nome workbook]&"]"&[Macro Pivot.Nome worksheet]&"'!G:J,4,0)),"&0&",VLOOKUP(A4,'["&[Macro Pivot.Nome workbook]&"]"&[Macro Pivot.Nome worksheet]&"'!G:J,4,0))"

    2. COPY AND PASTE WORKSHEET RANGE -> "C2" is source range and destination is "C2:C*".  As I SAID, we calculate the range.
    3. COPY AND PASTE WORKSHEET RANGE VALUE -> "C2:C*" source and destination is "C2". We delete formula and keep values.



    Matteo Pavone