<?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: [HOW TO] Integrate the SAS function &amp;quot;refresh multiple data&amp;quot; in a macro VBA in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74337#M1007</link>
    <description>Thanks Casey !&lt;BR /&gt;
&lt;BR /&gt;
I 'm out of the office for a week but as soon as I get back to work, I will try this.&lt;BR /&gt;
&lt;BR /&gt;
I let you now about this asap.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again

Message was edited by: Fab.from.be</description>
    <pubDate>Sun, 11 Apr 2010 14:18:52 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-04-11T14:18:52Z</dc:date>
    <item>
      <title>[HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74330#M1000</link>
      <description>Hi everybody !&lt;BR /&gt;
&lt;BR /&gt;
I want to integrate the function "refresh multiple data" from the SAS Add-In for Microsoft (see images attached here under).&lt;BR /&gt;
&lt;BR /&gt;
If I want to refresh a simple pivotTable in Excel, the VBA code is the following :&lt;BR /&gt;
&lt;BR /&gt;
    Sheets("Pivot Table").Select&lt;BR /&gt;
    Range("C13").Select&lt;BR /&gt;
    ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh&lt;BR /&gt;
    Sheets("Day").Select&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I try to register a macro when using the function "refresh multiple data" but it seems that MS do not recognise this SAS function when registering the VBA macro.&lt;BR /&gt;
&lt;BR /&gt;
Is there any documentation or code explaining how to integrate this SAS function in a VBA macro in Excel ?&lt;BR /&gt;
&lt;BR /&gt;
It is quite boring to do it manually when there is surely a way to automate it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance !&lt;BR /&gt;
&lt;BR /&gt;
Image 1 : &lt;IMG src="http://www.hiboox.fr/go/images/divers/sas-1,ef79c3ff18c04e812453b63a226c6ce3.jpg" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
Image 2 : &lt;IMG src="http://www.hiboox.fr/go/images/divers/sas-2,1cbec9a8eacead495039065cace7c650.jpg" /&gt;</description>
      <pubDate>Thu, 08 Apr 2010 06:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74330#M1000</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-08T06:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74331#M1001</link>
      <description>There is some documentation in SAS-&amp;gt;Help-&amp;gt;SAS Add-In for Microsoft Office Help.  See the "Working with Visual Basic Code" section under Contents.&lt;BR /&gt;
&lt;BR /&gt;
Here is an example macro:&lt;BR /&gt;
&lt;BR /&gt;
'For AMO 2.1 or 4.2&lt;BR /&gt;
'Add reference to "SAS_OfficeAddin"&lt;BR /&gt;
Sub RefreshWorkbook()&lt;BR /&gt;
&lt;BR /&gt;
    Dim ComAddin As ComAddin&lt;BR /&gt;
    Dim SasAddinObj As SASAddin&lt;BR /&gt;
    &lt;BR /&gt;
    Set ComAddin = Application.COMAddIns("SAS.OfficeAddin.Loader.ConnectProxy")&lt;BR /&gt;
    Set SasAddinObj = ComAddin.Object&lt;BR /&gt;
    Set ComAddin = Nothing&lt;BR /&gt;
        &lt;BR /&gt;
    ' refreshes all the AMO content (tasks, reports, data views, etc. in the workbook)&lt;BR /&gt;
    SasAddinObj.Refresh (Workbook)&lt;BR /&gt;
    &lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Additional features (opening data views, pivot tables, reports, running stored processes, etc.) have been added to the scripting inteface in AMO 4.3, due out later this year.</description>
      <pubDate>Thu, 08 Apr 2010 18:05:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74331#M1001</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2010-04-08T18:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74332#M1002</link>
      <description>Thanks !!!</description>
      <pubDate>Fri, 09 Apr 2010 05:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74332#M1002</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-09T05:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74333#M1003</link>
      <description>Hello, &lt;BR /&gt;
&lt;BR /&gt;
I 'm back again &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
I tried the macro you posted just here upper but I got an error message (see image 1)&lt;BR /&gt;
&lt;BR /&gt;
Image 1 : &lt;A href="http://free0.hiboox.com/images/1410/diapo357ed44476a7cb38744597a08063d423.jpg?39" target="_blank"&gt;http://free0.hiboox.com/images/1410/diapo357ed44476a7cb38744597a08063d423.jpg?39&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
So, I followed your advice and went to the Help in the SAS AddIn Section in XL.&lt;BR /&gt;
&lt;BR /&gt;
Then I tried to follow the instructions indicated in the Help section. I followed the instructions (instructions detailled under) and copied the code mentionned here under and got the message &lt;BR /&gt;
&lt;BR /&gt;
"compile error - only valid in object module"&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
Managing SAS Content&lt;/B&gt;&lt;BR /&gt;
&lt;B&gt;Writing event procedures in Excel&lt;/B&gt;&lt;BR /&gt;
To write an event procedure in Excel, follow these steps:&lt;BR /&gt;
Select Tools  Macro  Visual Basic Editor. The Microsoft Visual Basic Editor opens. &lt;BR /&gt;
In the Visual Basic Editor, select Tools  References. The References dialog box opens. &lt;BR /&gt;
From the list, select SAS.OfficeAddin and click OK.  &lt;B&gt;In the Project pane, double-click the class module for the existing workbook. &lt;BR /&gt;
In the code module for the workbook, insert the following code: &lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;BR /&gt;
----&lt;BR /&gt;
Private WithEvents sas As SASAddIn                                              &lt;BR /&gt;
&lt;BR /&gt;
Private Sub Workbook_Open()                                                     &lt;BR /&gt;
    Set sas = Application.COMAddIns.Item("SAS.OfficeAddin.Loader.ConnectProxy").object      &lt;BR /&gt;
End Sub                                                                         &lt;BR /&gt;
&lt;BR /&gt;
Private Sub sas_ItemUpdated(ByVal refreshableObject As Variant)                 &lt;BR /&gt;
    MsgBox "SAS item has been updated: " + refreshableObject                    &lt;BR /&gt;
End Sub&lt;BR /&gt;
----&lt;/I&gt;  &lt;BR /&gt;
&lt;BR /&gt;
 	The object name of the job is returned by the refreshableObject parameter of the ItemUpdated event. You can use this information to identify what job was refreshed. In Excel, the object name is the name of the range that contains the entire results from the job. To view the object name for a job, see the Object name field on the General tab of the Properties dialog box. 	 &lt;BR /&gt;
Select File  Close and Return to Microsoft Excel. &lt;BR /&gt;
&lt;BR /&gt;
To execute this code after you have inserted it, save the file and close Excel. The next time that you open the workbook this code is automatically executed.&lt;BR /&gt;
&lt;BR /&gt;
Image 2 : &lt;A href="http://free0.hiboox.com/images/1410/diapo64860ac0417425820887174fe67803a0.jpg?26" target="_blank"&gt;http://free0.hiboox.com/images/1410/diapo64860ac0417425820887174fe67803a0.jpg?26&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Image 3 : &lt;A href="http://free0.hiboox.com/images/1410/diapoba29ac334acebac47761bca030eec246.jpg?34" target="_blank"&gt;http://free0.hiboox.com/images/1410/diapoba29ac334acebac47761bca030eec246.jpg?34&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
:'(&lt;/B&gt;</description>
      <pubDate>Fri, 09 Apr 2010 06:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74333#M1003</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-09T06:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74334#M1004</link>
      <description>To use the macro I posted, you have to add a reference to "SAS_OfficeAddin" in the VBA editor (Tools-&amp;gt;References, check "SAS_OfficeAddin", OK, then run the macro).</description>
      <pubDate>Fri, 09 Apr 2010 14:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74334#M1004</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2010-04-09T14:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74335#M1005</link>
      <description>Hi again,&lt;BR /&gt;
&lt;BR /&gt;
Thank you Casey, but ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;The problem is that I don't have this option in the VBA editor as you can see in the images here under.&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
How do I have to have this option available in the VBA editor ?&lt;BR /&gt;
&lt;BR /&gt;
Image 2 : &lt;A href="http://free0.hiboox.com/images/1410/diapo64860ac0417425820887174fe67803a0.jpg?26" target="_blank"&gt;http://free0.hiboox.com/images/1410/diapo64860ac0417425820887174fe67803a0.jpg?26&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Image 3 : &lt;A href="http://free0.hiboox.com/images/1410/diapoba29ac334acebac47761bca030eec246.jpg?34" target="_blank"&gt;http://free0.hiboox.com/images/1410/diapoba29ac334acebac47761bca030eec246.jpg?34&lt;/A&gt;</description>
      <pubDate>Fri, 09 Apr 2010 19:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74335#M1005</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-09T19:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74336#M1006</link>
      <description>It is odd if "SAS_OfficeAddin" isn't in the list.  You may want to look at the top of the list as well since I noticed not all the items are alphabetized.&lt;BR /&gt;
&lt;BR /&gt;
If you can't find it, you can run that macro without adding a reference to "SAS_OfficeAddin" by removing or commenting out the "As SASAddin" by placing a single quote in front of it like so:&lt;BR /&gt;
    Dim SasAddinObj 'As SASAddin&lt;BR /&gt;
&lt;BR /&gt;
This may require you turning off options explicit.</description>
      <pubDate>Sat, 10 Apr 2010 16:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74336#M1006</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2010-04-10T16:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74337#M1007</link>
      <description>Thanks Casey !&lt;BR /&gt;
&lt;BR /&gt;
I 'm out of the office for a week but as soon as I get back to work, I will try this.&lt;BR /&gt;
&lt;BR /&gt;
I let you now about this asap.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again

Message was edited by: Fab.from.be</description>
      <pubDate>Sun, 11 Apr 2010 14:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74337#M1007</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-11T14:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74338#M1008</link>
      <description>Hi Casey,&lt;BR /&gt;
&lt;BR /&gt;
I try with the following as I don't find the Add-Ins in the list&lt;BR /&gt;
&lt;BR /&gt;
---Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Sub Macro1()&lt;BR /&gt;
'&lt;BR /&gt;
'For AMO 2.1 or 4.2&lt;BR /&gt;
'Add reference to "SAS_OfficeAddin"&lt;BR /&gt;
&lt;BR /&gt;
Dim ComAddin As ComAddin&lt;BR /&gt;
Dim SasAddinObj 'As SASAddin&lt;BR /&gt;
&lt;BR /&gt;
Set ComAddin = Application.COMAddIns("SAS.OfficeAddin.Loader.ConnectProxy")&lt;BR /&gt;
Set SasAddinObj = ComAddin.Object&lt;BR /&gt;
Set ComAddin = Nothing&lt;BR /&gt;
&lt;BR /&gt;
' refreshes all the AMO content (tasks, reports, data views, etc. in the workbook)&lt;BR /&gt;
SasAddinObj.Refresh ("DETAIL_BE")&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
---&lt;BR /&gt;
&lt;BR /&gt;
It seems it's working but ... I don't get the same table I 'm used to see when I launch "refresh data multiple".&lt;BR /&gt;
&lt;BR /&gt;
In fact I don't see anything working.&lt;BR /&gt;
&lt;BR /&gt;
How can I be sure that the refresh has been done ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Normally I get a table with things to checkboxes&lt;BR /&gt;
&lt;BR /&gt;
* Select ALL&lt;BR /&gt;
* Refresh items in order (last run time for select items : 3 seconds)&lt;BR /&gt;
* modify items before refreshing (this one is not chosen)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Your feedback will be greatly appreciate &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thank you !&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Fab.from.be

Message was edited by: Fab.from.be</description>
      <pubDate>Mon, 19 Apr 2010 14:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74338#M1008</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-19T14:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: [HOW TO] Integrate the SAS function "refresh multiple data" in a macro VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74339#M1009</link>
      <description>That VBA macro is not interactive -- it doesn't show any UI.  It simply refreshes one or more pieces of content (data views, PivotTables, reports, stored processes).  To verify that it actually refreshed, you can either change values in the source data or delete some of the values in the results in the worksheet, then run the macro and ensure the latest values are retrieved (Excel doesn't allow you to delete values in a PivotTable, so you'd have to change the source data to verify it).</description>
      <pubDate>Mon, 19 Apr 2010 14:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/HOW-TO-Integrate-the-SAS-function-quot-refresh-multiple-data/m-p/74339#M1009</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2010-04-19T14:57:44Z</dc:date>
    </item>
  </channel>
</rss>

