BookmarkSubscribeRSS Feed
nine3quarters
Calcite | Level 5

Hi all,

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.

The server where the report is saved is https://vsmartanalytics.intranet.mycompany.eu and the path within the server is /DataGovernance/Teamxxx/Reports/ReportName

This is the dialog box which appears when I click on Reports in the Excel workbook

nine3quarters_0-1624027586706.png

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.

I tested it with this routine

Sub InsertReport2G()

  Dim sas As SASExcelAddIn

  Dim report As SASReport2G
  Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object

  Set report = sas.InsertReport2GFromSASFolder("https://vsmartanalytics.intranet.mycompany.eu/DataGovernance/Teamxxx/Reports/ReportName",   Sheet1.Range("A1"))

End Sub

but it doesn't work and returns a Runtime Error '2146232832 (80131600)'.

I added the reference and the HelloWorld method works, maybe the string I inserted for the path is wrong, or it's the wrong method, I don't know.

Can you help me, please?

Thank you

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Discussion stats
  • 0 replies
  • 1173 views
  • 0 likes
  • 1 in conversation