<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic COPY AND PASTE RECODS TO A FILTERED WORKSHEET in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75539#M28144</link>
    <description>COPY AND PASTE RECODS TO A FILTERED WORKSHEET?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Oyinkansola Musa&lt;BR /&gt;------------------------------</description>
    <pubDate>Wed, 15 Jun 2022 10:28:00 GMT</pubDate>
    <dc:creator>musaoyinkan</dc:creator>
    <dc:date>2022-06-15T10:28:00Z</dc:date>
    <item>
      <title>COPY AND PASTE RECODS TO A FILTERED WORKSHEET</title>
      <link>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75539#M28144</link>
      <description>COPY AND PASTE RECODS TO A FILTERED WORKSHEET?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Oyinkansola Musa&lt;BR /&gt;------------------------------</description>
      <pubDate>Wed, 15 Jun 2022 10:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75539#M28144</guid>
      <dc:creator>musaoyinkan</dc:creator>
      <dc:date>2022-06-15T10:28:00Z</dc:date>
    </item>
    <item>
      <title>RE: COPY AND PASTE RECODS TO A FILTERED WORKSHEET</title>
      <link>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75540#M28145</link>
      <description>Hi @Oyinkansola&amp;nbsp;Musa,&lt;BR /&gt;&lt;BR /&gt;You have to open file using Excel vbo and used "Go To Next Empty cell down" &amp;amp; "Go To Next Empty cell Right"&amp;nbsp; action to get the correct data.&lt;BR /&gt;&lt;BR /&gt;after that need to use "Copy and paste worksheet range" action and need to pass the input parameters&lt;BR /&gt;&lt;BR /&gt;Do let us know if you need any help&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nilesh Jadhav &lt;BR /&gt;Senior RPA Specialist&lt;BR /&gt;ADP&lt;BR /&gt;India&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2022 14:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75540#M28145</guid>
      <dc:creator>NileshJadhavBP</dc:creator>
      <dc:date>2022-06-20T14:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: COPY AND PASTE RECODS TO A FILTERED WORKSHEET</title>
      <link>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75541#M28146</link>
      <description>&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/34034"&gt;@musaoyinkan&lt;/a&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This issue even I had faced in the past and for this you have to actually create a custom action using a tiny little modification in one of the existing code stages. First, I would recommend you to download​ the latest&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'MS Excel - Extended'&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;VBO business object which is also available in the following DX Exchange URL:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://digitalexchange.blueprism.com/dx/entry/9648/solution/ms-excel-vbo---extended" target="_blank" rel="noopener"&gt;Function for MS Excel VBO - Extended - 2.3.3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;STRONG&gt;Solution Explanation:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;You need to create a duplicate action,&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Copy and Paste Worksheet Range'&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;for one of the existing actions within this business object. You can name your new action as&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Copy and Paste Worksheet Range - Visible Cells'&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;as shown below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15352.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15516iE82A471720A4927C/image-size/large?v=v2&amp;amp;px=999" role="button" title="15352.png" alt="15352.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15353.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15515i866044002785D423/image-size/large?v=v2&amp;amp;px=999" role="button" title="15353.png" alt="15353.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should now see a duplicated action with this new name getting created:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15354.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15518i33BC5B84A921748A/image-size/large?v=v2&amp;amp;px=999" role="button" title="15354.png" alt="15354.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here you need to change the name of the code stage to&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Paste Worksheet - Visible Cells'&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;as I have done above. Now inside the code stage you need to paste the exact same code as I have shown below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-vbnet"&gt;&lt;CODE&gt;Dim sw, dw As Object
Dim ss, ds As Object
Dim excel, sheet, source, destination, cells, cell As Object
Const xlCellTypeVisible As Int32 = 12

Try

sw = GetWorkbook(Handle, Source_Workbook)
dw = GetWorkbook(Handle, Destination_Workbook)

ss = GetWorksheet(Handle, Source_Workbook, Source_Worksheet)
ds = GetWorksheet(Handle, Destination_Workbook, Destination_Worksheet)

sw.Activate()
ss.Activate()
excel = ss.Application
sheet = excel.ActiveSheet
cell = excel.ActiveCell

If Source_Range="" Then
	cells = sheet.Cells.SpecialCells(xlCellTypeVisible)
	Destination_Range = "A1"
Else
	cells = sheet.Range(Source_Range).SpecialCells(xlCellTypeVisible)
End If

cells.Select()
source = excel.Selection
source.Copy()
cell.Select()

dw.Activate()
ds.Activate()
sheet = excel.ActiveSheet
cell = excel.ActiveCell
destination = sheet.Range(Destination_Range)
destination.Select()
sheet.Paste()
cell.Select()

My.Computer.Clipboard.Clear()

Success = True

Catch e As Exception
	Success = False
	Message = e.Message
Finally
	sw = Nothing
	ss = Nothing
	dw = Nothing
	ds = Nothing
	excel = Nothing
	sheet = Nothing
	source = Nothing
	destination = Nothing
	cells = Nothing
	cell = Nothing
End Try​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Here, just to explain you I have added one line at the top to the original code:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Const xlCellTypeVisible As Int32 = 12&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and then I am using it at places like:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;cells = sheet.Cells.SpecialCells(xlCellTypeVisible)&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and cells =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;sheet.Range(Source_Range).SpecialCells(xlCellTypeVisible)&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;These lines help me to tell the code that it only needs to pick up the visible cells on the screen apart from the entire range which the original code did by default.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;STRONG&gt;Testing For Solution:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, publish your action and then use all the actions of the same business object where you have done the changes in your process studio while interacting with the excel file in order to avoid any exceptions. I have a sample process studio workflow shown below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="15355.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15522i28FA6C79DC8AEC80/image-size/large?v=v2&amp;amp;px=999" role="button" title="15355.png" alt="15355.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So just to explain you a sample scenario which I have picked up, I basically have an excel file with below original table data with an applied filter on top of it and I need to paste this data completely to a blank sheet called as '&lt;STRONG&gt;Results&lt;/STRONG&gt;' which already exists:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15356.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15519i8D003B075AD67FF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="15356.png" alt="15356.png" /&gt;&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15357.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15517i37B4202C1A9DF645/image-size/large?v=v2&amp;amp;px=999" role="button" title="15357.png" alt="15357.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, in order for this solution to work remember it should not be used in background mode otherwise it can throw errors and that is reason why you must use a Show action in between as I have used in my workflow.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Hence, I am creating an excel instance, then opening my excel file, then making it visible on the screen and then I use my new created action which has the below parameters:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15358.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15524iA747DF3ACBCB5BD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="15358.png" alt="15358.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here, I have left the source range parameter as blank since I want to copy all the cells and not define any range to it. Post execution of the workflow I get the below results:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15359.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/15525iF788F5E78D4FE38D/image-size/large?v=v2&amp;amp;px=999" role="button" title="15359.png" alt="15359.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So here as you can see you can provide the proper source and destination details to get the desired filtered copy paste operation completed&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2022 22:38:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/COPY-AND-PASTE-RECODS-TO-A-FILTERED-WORKSHEET/m-p/75541#M28146</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-20T22:38:00Z</dc:date>
    </item>
  </channel>
</rss>

