<?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 RE: MS Excel Pivot Table Filtering in Digital Exchange</title>
    <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51317#M403</link>
    <description>&lt;P&gt;Hi &lt;SPAN&gt;Theodoros,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;What error do you get when you try to open the file with your code?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Tue, 01 Jun 2021 12:55:00 GMT</pubDate>
    <dc:creator>GopalBhaire</dc:creator>
    <dc:date>2021-06-01T12:55:00Z</dc:date>
    <item>
      <title>MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51316#M402</link>
      <description>Hi All,&lt;BR /&gt;I'm new in BluePrism and I have the following scenario. There is an excel with 2 pivot tables. I need to change the filter, apply refresh and save the excel with the updated values in order to send as an attachment via email. Object MS Excel VBO - Extended doesn't seem to work properly for that work (I understand 'Add Criteria to Page Field for Pivot Table' action is only for creation and not in an already created pivot?), therefore I ended up trying my lock with Code stage. Unsuccessfully though so far. RefreshTable seems to work fine if I go first in the excel and uncheck the option 'Refresh data when opening the file', otherwise it gives me an error while opening the workbook. The problem is that the excel is exported with 'Refresh data when opening the file' checked.&amp;nbsp;&lt;BR /&gt;I tried the below code but no luck so far:&lt;BR /&gt;&lt;BR /&gt;Dim ws As Object&lt;BR /&gt;ws = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;ws.Activate()&lt;BR /&gt;ws.AutoFilterMode = False&lt;BR /&gt;ws.PivotTables(PivotTableName).PivotFields(Field).CurrentPage = Criteria&lt;BR /&gt;ws.PivotTables(PivotTableName).RefreshTables&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline"&gt;Input Parameters:&lt;/SPAN&gt;&lt;BR /&gt;Handle (Number) = 1&lt;BR /&gt;Workbook (Text) - The name of the workbook&lt;BR /&gt;Worksheet (Text) - The name of the worksheet&lt;BR /&gt;PivotTableName (Text) - The name of the pivot table&lt;BR /&gt;Field (Text) - The name of the field that filter applies&lt;BR /&gt;Criteria (Text) - The value for the filter that I want to apply&lt;BR /&gt;&lt;BR /&gt;Any Ideas are most welcome! Thanks in advance!&lt;BR /&gt;#pivottable​​ #pivotfilter #pivotrefresh​​​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Theodoros Papasotiriou&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jun 2021 11:47:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51316#M402</guid>
      <dc:creator>TheodorosPapaso</dc:creator>
      <dc:date>2021-06-01T11:47:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51317#M403</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Theodoros,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;What error do you get when you try to open the file with your code?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jun 2021 12:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51317#M403</guid>
      <dc:creator>GopalBhaire</dc:creator>
      <dc:date>2021-06-01T12:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51318#M404</link>
      <description>Hi Gopal and thanks for the quick reply. I get "Internal: Could not execute code stage because exception thrown by code stage: Unable to get the PivotFields property of the Pivot Table class"&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Theodoros Papasotiriou&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jun 2021 13:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51318#M404</guid>
      <dc:creator>TheodorosPapaso</dc:creator>
      <dc:date>2021-06-01T13:12:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51319#M405</link>
      <description>&lt;P&gt;Hi Theodoros,&lt;/P&gt;
&lt;P&gt;While I checked stackoverflow for the error it indicates that the error is due to incorrect name of field but according to you it works when Refresh is turned off. So maybe you can try this before changing the Criteria and the turn it back to true at the end. Not sure if that'll work&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;ws.PivotTables("PivotTable2").PivotCache.RefreshOnFileOpen = False&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:40:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51319#M405</guid>
      <dc:creator>GopalBhaire</dc:creator>
      <dc:date>2021-06-01T17:40:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51320#M406</link>
      <description>Hi Gopal,&lt;BR /&gt;&lt;BR /&gt;Eventually it worked with the "Excel VBO-Extended" action "Add Criteria to Page Field Filter for Pivot Table"&amp;nbsp; (code below)&lt;BR /&gt;Dim ws As Object&lt;BR /&gt;ws = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;ws.Activate()&lt;BR /&gt;ws.PivotTables(PivotTableName).PivotFields(Field).CurrentPage = Criteria&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline"&gt;&lt;STRONG&gt;Input&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Handle (Number) = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Workbook (Text) - The name of the workbook&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Worksheet (Text) - The name of the worksheet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PivotTableName (Text) - The name of the pivot table&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Field (Text) - The name of the field that filter applies&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Criteria (Text) - The value for the filter that I want to apply&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;The problem was that within the PivotTable Options, the "Refresh data when opening the file" (under tab Data) was unchecked, therefore I needed to trigger a Refresh (PivotTable.RefreshTable) before applying the filter...&lt;BR /&gt;&lt;BR /&gt;Now, I'm trying to change this value from the code ... Tried with your code above (I assume this is what it does), but before calling the function, when trying to Open Workbook in order to read the worksheet name, I get an error when "Refresh data when opening the file" is checked (it's like a deadlock)....Not sure if I can change the value without opening the workbook somehow&lt;BR /&gt;&lt;BR /&gt;Thanks Gopal!&lt;BR /&gt;Best,&lt;BR /&gt;Theo&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Theodoros Papasotiriou&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 09:14:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51320#M406</guid>
      <dc:creator>TheodorosPapaso</dc:creator>
      <dc:date>2021-06-02T09:14:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51321#M407</link>
      <description>&lt;P&gt;Hi Theodoros,&lt;/P&gt;
&lt;P&gt;Are you getting error while opening workbook or while applying filter? I tried changing filter of sample excel with two pivot and it worked for me with &lt;SPAN&gt;"Refresh data when opening the file" checked. I added &lt;CODE&gt;ws.PivotTables(PivotTableName).PivotCache.Refresh&lt;/CODE&gt; at the very end of the code in 'Add Criteria to Page Field Filter for Pivot Table' code to refresh table after the criteria change.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My steps &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Create Instance&lt;BR /&gt;2. Open Workbook&lt;BR /&gt;3. Add Criteria to Page Field Filter for Pivot Table&lt;BR /&gt;4. Close All Instance (with save)&lt;BR /&gt;&lt;BR /&gt;I would recommend you record a macro from the Developer tab of Excel to check if the field name and everything is all right.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 11:02:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51321#M407</guid>
      <dc:creator>GopalBhaire</dc:creator>
      <dc:date>2021-06-02T11:02:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51322#M408</link>
      <description>Hi Gopal,&lt;BR /&gt;Unfortunately I get the error much before the 'Add Criteria to Page Field Filter for Pivot Table'. &lt;BR /&gt;I follow the same order as yours. Error comes on Open Workbook: "HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)".... When I uncheck manually &lt;SPAN&gt;&amp;nbsp;the "Refresh data when opening the file"&amp;nbsp; it works fine. However, the excel that I will process with my solution comes with the property checked. Therefore I'm trying to apply a code to uncheck that property before calling the Open Workbook (unsuccessfully so far)&lt;BR /&gt;&lt;/SPAN&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Theodoros Papasotiriou&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 12:41:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51322#M408</guid>
      <dc:creator>TheodorosPapaso</dc:creator>
      <dc:date>2021-06-02T12:41:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51323#M409</link>
      <description>Can you put it in recover and retry with a 30 sec sleep and check?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 12:53:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51323#M409</guid>
      <dc:creator>GopalBhaire</dc:creator>
      <dc:date>2021-06-02T12:53:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51324#M410</link>
      <description>That was a good idea but unfortunately even after 30 sec sleep it goes back to the same error every time I call Open Workbook&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Theodoros Papasotiriou&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 16:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51324#M410</guid>
      <dc:creator>TheodorosPapaso</dc:creator>
      <dc:date>2021-06-02T16:06:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51325#M411</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Theodoros,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are okay with adding libraries you can try &lt;A href="https://github.com/codebygb/BP-OpenExcel-VBO" target="_blank" rel="noopener"&gt;this&lt;/A&gt;, I was working on creating a VBO with ClosedXML, I added an Update Pivot Criteria action which you can try.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;OpenWorkBook -&amp;gt;Update Pivot Criteria-&amp;gt;Close Workbook&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jun 2021 12:52:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51325#M411</guid>
      <dc:creator>GopalBhaire</dc:creator>
      <dc:date>2021-06-04T12:52:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51326#M412</link>
      <description>Hi Gopal,&lt;BR /&gt;Apologies for replying late. Unfortunately even with the library added it didn't work because on Open Workbook, it's giving me the error. For the record, eventually I implemented it using Recover-Resume, catching and skipping the error.&lt;BR /&gt;Thanks for your help!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Theodoros Papasotiriou&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jul 2021 18:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51326#M412</guid>
      <dc:creator>TheodorosPapaso</dc:creator>
      <dc:date>2021-07-12T18:12:00Z</dc:date>
    </item>
    <item>
      <title>RE: MS Excel Pivot Table Filtering</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51327#M413</link>
      <description>NP, Glad you could make it work &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gopal Bhaire&lt;BR /&gt;Analyst&lt;BR /&gt;Accenture&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jul 2021 05:48:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/MS-Excel-Pivot-Table-Filtering/m-p/51327#M413</guid>
      <dc:creator>GopalBhaire</dc:creator>
      <dc:date>2021-07-13T05:48:00Z</dc:date>
    </item>
  </channel>
</rss>

