Copy Excel, Paste Word Issues

Hi everyone,

I see a few similar posts about this, but none have helped my issue. Basically, I need to move tables from a list of excel files all into one master word file. Please see attached xaml + details below.

I would really appreciate any thoughts on how to successfully do this, as I’m leaning toward leaving this part manual or trying to layer in some kind of R or powershell script to get this to work.

Details: I need to iterate through a folder filled with excel documents, each containing a table with some pretty specific formatting (would be nearly impossible to recreate after pasting in Word due to the variability of sections in the table). The loop works fine, my issue is actually copy and pasting the tables.

Currently I have:

  • ctrl + a, ctrl + a (to get the entire excel sheet, not just top section), ctrl + c, “Get From Clipboard” activity in the origin excel sheets,

  • then ctrl + v in the Word doc.

When I run the process I have defined currently, nothing gets pasted into the Word doc.

If I put a breakpoint right before the ctrl + v activity, then manually click ctrl + v, a full page of text gets pasted into the target word doc, (see example below)

example of manual paste from uipath ctrl + c:

<?xml version="1.0" encoding="utf-16"?><ClipboardData Version="1.0" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"

excel copy - word paste.zip (45.4 KB)

Hi @Shelby_Pons have u tried converting excel into datatable and then using insert document activity in word application scope.

Yes, I have tried read range from excel, then planned to use bookmarks as reference for the insert data table activity in word. The problem is, even with “preserve format” checked for the read range activity, that doesn’t maintain the proper coloring and merged cell organization.

Example on the difference between the table from Excel (which I need to maintain formatting for) and the output when I use read range > insert data table. Based on the variability between the different Excel’s, I think formatting the table after inserting won’t work.


Hi @Shelby_Pons Check this Sequence13.xaml (13.1 KB)

2 Likes

Thank you, friend! I appreciate you looking into this.

Did you install a package for a special activity? The last one after the second Ctrl + a hotkey is showing as “missing or invalid”

Hi @Shelby_Pons No I didnt used any special activity.Did it met the expected output?.Also If u are using this method u have make dynamic selector in attach window then it will read all excel files and cpy paste it in word.

Could you include screen shot to explain what this last activity is?

Hi @Shelby_Pons u need to install UiPath.Word.Activities package from manage package or update the package.

1 Like

Of course! Thank you.

Also, this is the result when I run the workflow. Any thoughts on how to get the actual table to paste rather than this code?

image

Paste.docx (16.2 KB)

Hi @Shelby_Pons I m getting this output Paste.docx (14.2 KB)

I made a small change, and it works perfectly for me now too. Thank you! Not sure why I’m still getting an issue in my real project file. . . Might be corrupt. I will recreate and include your sequence in my loop. Thank you!!!

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