How to paste Table from one Excel file to Another Excel file, considering same table layout and design

Hello Everyone
So basically I want to copy entire table from one excel sheet and paste it to another excel sheet considering the formatted table layout and design should be same. Is there any activity for it? or there is some logic to it.
Thanks in advance

Hello,

As far as I know Excel WriteRange activities don’t copy over formats. Here is a link to this video that might help:

I use the Keyboard shortcuts to “Select All” (Ctrl+A) and “Copy” (Ctrl+C) and then do the same for pasting to the other excel sheet.
Hopefully that works for you.

image

Hi @Daniyal_Tahir

You can use excel VBA to do this process there are two ways we can call a excel vba macro in UiPath,

Please refer this for how to use VBA in UiPath

By using execute macro activity

By using invoke VBA activity

And please refer this for how to copy data from one workbook to other.

Thanks

Hello @Daniyal_Tahir ,

Here are the detailed steps:

  1. If it’s the first time you are using Excel VBA in Uipath, you need to give it access by going to Excel > Options > Trust Center > Trust Center Settings > Macro Settings > Trust Access to the VBA project object model

  1. Use Excel Application Scope with Invoke VBA activity.
    image

    1. If you want to copy the whole sheet, use the following macro:
      Copy Sheet Macro.txt (128 Bytes)
      where you can change the values of “Sheet1” and “newSheet”

    2. If you want to copy an excel table, use the following macro:
      Copy Table Macro.txt (144 Bytes)
      where you can change the value of “Sheet1”, “newSheet”, and “Table1”

Best,
Charbel

Is there any other way wihout using vba/macro? Like an activity or simpler way?

Hi @Daniyal_Tahir

If you want to copy all the data from one sheet to other, we can use copy sheet activity (use inside excel application scope),

or try using balareva activities which have multiple activity to copy cells data and format

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.