<?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 SAS addin 7.1excel sheet  macro to refresh in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470211#M2251</link>
    <description>&lt;P&gt;I am using excel sheet with SAS addin 7.1 . I want to refresh all the data including data sets and pivot tables of the workbook with a macro. I also tried the following macro but the error is "compile error: user-defined type not defined" in the highlighted line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Private Sub Workbook_Open()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.COMAddIns.Item("SAS.ExcelAddIn").Connect = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#FF6600"&gt;&lt;U&gt;Dim SAS As SASExcelAddIn&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set SAS = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS.Refresh (SheetName)&lt;/P&gt;&lt;P&gt;end sub()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: the declaration of SASexcel addin is the place where the problem persists everytime&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Varun A&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jun 2018 07:22:00 GMT</pubDate>
    <dc:creator>varun45</dc:creator>
    <dc:date>2018-06-14T07:22:00Z</dc:date>
    <item>
      <title>SAS addin 7.1excel sheet  macro to refresh</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470211#M2251</link>
      <description>&lt;P&gt;I am using excel sheet with SAS addin 7.1 . I want to refresh all the data including data sets and pivot tables of the workbook with a macro. I also tried the following macro but the error is "compile error: user-defined type not defined" in the highlighted line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Private Sub Workbook_Open()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.COMAddIns.Item("SAS.ExcelAddIn").Connect = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#FF6600"&gt;&lt;U&gt;Dim SAS As SASExcelAddIn&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set SAS = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS.Refresh (SheetName)&lt;/P&gt;&lt;P&gt;end sub()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: the declaration of SASexcel addin is the place where the problem persists everytime&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Varun A&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 07:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470211#M2251</guid>
      <dc:creator>varun45</dc:creator>
      <dc:date>2018-06-14T07:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS addin 7.1excel sheet  macro to refresh</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470217#M2252</link>
      <description>&lt;P&gt;I use this in my excel to refresh everything. Note te delay that makes everything sync, not the nices solution, but it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sub RefreshSasContent()&lt;BR /&gt; Dim sas As SASExcelAddIn&lt;BR /&gt; Dim pt As PivotTable&lt;BR /&gt; Dim ws As Worksheet&lt;BR /&gt; Dim slcr As SlicerCache&lt;BR /&gt; Dim dblEndTime As Double&lt;BR /&gt; &lt;BR /&gt; ' Refresh SAS content&lt;BR /&gt; Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;BR /&gt; sas.Refresh ThisWorkbook&lt;BR /&gt; &lt;BR /&gt; '&amp;nbsp;Add a pause otherwise the update of the pivots doesn't work&lt;BR /&gt; dblEndTime = Timer + 1&lt;BR /&gt; Do While Timer &amp;lt; dblEndTime&lt;BR /&gt; DoEvents&lt;BR /&gt; Loop&lt;BR /&gt; &lt;BR /&gt;Refresh&amp;nbsp;all pivots&lt;BR /&gt; For Each PivotCache In ActiveWorkbook.PivotCaches&lt;BR /&gt; PivotCache.Refresh&lt;BR /&gt; Next&lt;BR /&gt; &lt;BR /&gt; ' Remove selections&lt;BR /&gt; For Each slcr In ActiveWorkbook.SlicerCaches&lt;BR /&gt; slcr.ClearManualFilter&lt;BR /&gt; Next slcr&lt;BR /&gt; &lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 08:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470217#M2252</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-06-14T08:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS addin 7.1excel sheet  macro to refresh</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470404#M2253</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211377"&gt;@varun45&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you add the SAS Add-in reference to your VBA project? From the SAS Add-in help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-06-14_14-09-04.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21201i27DB3F7A71595E88/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-06-14_14-09-04.png" alt="2018-06-14_14-09-04.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 18:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470404#M2253</guid>
      <dc:creator>fifthand57th</dc:creator>
      <dc:date>2018-06-14T18:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS addin 7.1excel sheet  macro to refresh</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470959#M2255</link>
      <description>actually when declaring sas addin in VBA the auto completion is not working for SAS declaration alone and after typing it when executing it is showing like "user defined type not defined"&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jun 2018 02:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/470959#M2255</guid>
      <dc:creator>varun45</dc:creator>
      <dc:date>2018-06-18T02:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS addin 7.1excel sheet  macro to refresh</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/471094#M2256</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211377"&gt;@varun45&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, autocomplete should not work until the reference is active. Did you follow the screen shot in my previous post and enable the SAS Add-in for Microsoft Office reference before writing any SAS Add-in related VBA?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SAS-addin-7-1excel-sheet-macro-to-refresh/m-p/471094#M2256</guid>
      <dc:creator>fifthand57th</dc:creator>
      <dc:date>2018-06-18T14:14:40Z</dc:date>
    </item>
  </channel>
</rss>

