<?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 Inserting a Visual Analytics Report (Report2G) with VBA code in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Inserting-a-Visual-Analytics-Report-Report2G-with-VBA-code/m-p/748913#M2514</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to insert a Visual Analytics report (2G) in a Microsoft Excel Workbook, automating it using the SAS Add-In 8.2 for Microsoft Office and VBA code.&lt;/P&gt;&lt;P&gt;The server where the report is saved is &lt;EM&gt;&lt;A href="https://vsmartanalytics.intranet.mycompany.eu" target="_blank"&gt;https://vsmartanalytics.intranet.mycompany.eu&lt;/A&gt;&amp;nbsp;&lt;/EM&gt;and the path within the server is &lt;EM&gt;/DataGovernance/Teamxxx/Reports/ReportName&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This is the dialog box which appears when I click on Reports in the Excel workbook&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nine3quarters_0-1624027586706.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60479i2315C40D3555B941/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nine3quarters_0-1624027586706.png" alt="nine3quarters_0-1624027586706.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that the reports are not on a SAS Folder but on a Visual Analytics server, if you click on "SAS Folders" it's empty, but I think the only method I can use to insert the report with VBA code is InsertReport2GFromSASFolder.&lt;/P&gt;&lt;P&gt;I tested it with this routine&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sub InsertReport2G()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Dim sas As SASExcelAddIn&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Dim report As SASReport2G&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;Set report = sas.InsertReport2GFromSASFolder("&lt;A href="https://vsmartanalytics.intranet.mycompany.eu" target="_blank"&gt;https://vsmartanalytics.intranet.mycompany.eu/DataGovernance/Teamxxx/Reports/ReportName&lt;/A&gt;",&amp;nbsp; &amp;nbsp;Sheet1.Range("A1"))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;End Sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work and returns a Runtime Error '2146232832 (80131600)'.&lt;/P&gt;&lt;P&gt;I added the reference and the HelloWorld method works,&amp;nbsp;maybe the string I inserted for the path is wrong, or it's the wrong method, I don't know.&lt;/P&gt;&lt;P&gt;Can you help me, please?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 15:15:48 GMT</pubDate>
    <dc:creator>nine3quarters</dc:creator>
    <dc:date>2021-06-18T15:15:48Z</dc:date>
    <item>
      <title>Inserting a Visual Analytics Report (Report2G) with VBA code</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Inserting-a-Visual-Analytics-Report-Report2G-with-VBA-code/m-p/748913#M2514</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to insert a Visual Analytics report (2G) in a Microsoft Excel Workbook, automating it using the SAS Add-In 8.2 for Microsoft Office and VBA code.&lt;/P&gt;&lt;P&gt;The server where the report is saved is &lt;EM&gt;&lt;A href="https://vsmartanalytics.intranet.mycompany.eu" target="_blank"&gt;https://vsmartanalytics.intranet.mycompany.eu&lt;/A&gt;&amp;nbsp;&lt;/EM&gt;and the path within the server is &lt;EM&gt;/DataGovernance/Teamxxx/Reports/ReportName&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This is the dialog box which appears when I click on Reports in the Excel workbook&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nine3quarters_0-1624027586706.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60479i2315C40D3555B941/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nine3quarters_0-1624027586706.png" alt="nine3quarters_0-1624027586706.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that the reports are not on a SAS Folder but on a Visual Analytics server, if you click on "SAS Folders" it's empty, but I think the only method I can use to insert the report with VBA code is InsertReport2GFromSASFolder.&lt;/P&gt;&lt;P&gt;I tested it with this routine&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sub InsertReport2G()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Dim sas As SASExcelAddIn&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Dim report As SASReport2G&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;Set report = sas.InsertReport2GFromSASFolder("&lt;A href="https://vsmartanalytics.intranet.mycompany.eu" target="_blank"&gt;https://vsmartanalytics.intranet.mycompany.eu/DataGovernance/Teamxxx/Reports/ReportName&lt;/A&gt;",&amp;nbsp; &amp;nbsp;Sheet1.Range("A1"))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;End Sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work and returns a Runtime Error '2146232832 (80131600)'.&lt;/P&gt;&lt;P&gt;I added the reference and the HelloWorld method works,&amp;nbsp;maybe the string I inserted for the path is wrong, or it's the wrong method, I don't know.&lt;/P&gt;&lt;P&gt;Can you help me, please?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 15:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Inserting-a-Visual-Analytics-Report-Report2G-with-VBA-code/m-p/748913#M2514</guid>
      <dc:creator>nine3quarters</dc:creator>
      <dc:date>2021-06-18T15:15:48Z</dc:date>
    </item>
  </channel>
</rss>

