<?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 Change Excel pivot table properties through SAS in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135771#M1368</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a project trying to control the Excel pivot table through SAS. Basically I wrote SAS code to update the data in Excel worksheet, then refresh the linked pivot tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DDE is the main method I use. with the X4ML code like &lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;PUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'[workbook.protect(FALSE,FALSE,"'"&amp;amp;psw"'")]'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;I am able to open Excel file in SAS, protect or unprotect the workbook, update data, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the questions: DDE or X4ML are very old and limited and I have to search for some better methods to&lt;/P&gt;&lt;P&gt;1. Change the data source of the pivot table. For example the original data source is r1c1:r5c4. After updating there are two more rows to be included and the source should be r1c1:r7c4.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/5115_1.png" /&gt;&lt;/P&gt;&lt;P&gt;2. Modify protection attributes. When protecting the Exce worksheet, I'd like the user could use pivot table. In other words, check the option in the picture below.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;IMG alt="2.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/5116_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;The requirement is, all of these should be done in SAS. I know it is easy to write a piece of macro in Excel but that's not allowed. I believe every function in Excel has a corresponding command that could be used in SAS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;Anyone have any idea about these? Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;BR /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Mar 2014 21:12:50 GMT</pubDate>
    <dc:creator>peterluo</dc:creator>
    <dc:date>2014-03-06T21:12:50Z</dc:date>
    <item>
      <title>Change Excel pivot table properties through SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135771#M1368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a project trying to control the Excel pivot table through SAS. Basically I wrote SAS code to update the data in Excel worksheet, then refresh the linked pivot tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DDE is the main method I use. with the X4ML code like &lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;PUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'[workbook.protect(FALSE,FALSE,"'"&amp;amp;psw"'")]'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;I am able to open Excel file in SAS, protect or unprotect the workbook, update data, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the questions: DDE or X4ML are very old and limited and I have to search for some better methods to&lt;/P&gt;&lt;P&gt;1. Change the data source of the pivot table. For example the original data source is r1c1:r5c4. After updating there are two more rows to be included and the source should be r1c1:r7c4.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/5115_1.png" /&gt;&lt;/P&gt;&lt;P&gt;2. Modify protection attributes. When protecting the Exce worksheet, I'd like the user could use pivot table. In other words, check the option in the picture below.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;IMG alt="2.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/5116_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;The requirement is, all of these should be done in SAS. I know it is easy to write a piece of macro in Excel but that's not allowed. I believe every function in Excel has a corresponding command that could be used in SAS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;Anyone have any idea about these? Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;BR /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2014 21:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135771#M1368</guid>
      <dc:creator>peterluo</dc:creator>
      <dc:date>2014-03-06T21:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change Excel pivot table properties through SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135772#M1369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the datasource to be the full worksheet and select out blanks in your pivot table instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2014 21:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135772#M1369</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-06T21:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change Excel pivot table properties through SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135773#M1370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; When you state your believe that "every function in Excel has a corresponding command that could be used in SAS", I am not sure that this is true. I would recommend that you work with Tech Support on your question. In addition, at the beginning of your post, you say that "DDE or X4ML are very old and limited and I have to search for some better methods to 1)... 2)...."&amp;nbsp; Here's an interesting paper that uses VB.NET technology to interact between SAS and Excel (&lt;A href="http://support.sas.com/resources/papers/proceedings10/191-2010.pdf" title="http://support.sas.com/resources/papers/proceedings10/191-2010.pdf"&gt;http://support.sas.com/resources/papers/proceedings10/191-2010.pdf&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 15:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135773#M1370</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-10T15:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Change Excel pivot table properties through SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135774#M1371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not saying you should, but if you use xlsx you could manipulate the XML directly.&amp;nbsp; The XLSX is a zip file, if you rename it and then open it there are various folders/XML docs.&amp;nbsp; At a rough guess I think \xl\pivotTables\pivotTable1.xml is probably the one to edit (of course this is assuming the file already has&amp;nbsp; pivot table and it is called pivotTable1).&amp;nbsp; You could read up on the Microsoft open document format if your interested in reading/writing directly though its a bit of a chore.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 16:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Change-Excel-pivot-table-properties-through-SAS/m-p/135774#M1371</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-03-10T16:18:47Z</dc:date>
    </item>
  </channel>
</rss>

