SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Save Excel workbook generated with SAS Add-In with today's date in the filename

Reply
Occasional Contributor
Posts: 5

Save Excel workbook generated with SAS Add-In with today's date in the filename

I'm not sure if this is possible, but I am wanting to save an Excel workbook that is populated using the SAS Add-In with the date the file was run in the filename. (EX.-reportname_ddmmyyyy.xlsx). I have a copy file macro that one of my teammates used to accomplish this in EG, but wasn't sure if this will translate to the Add-In. This is part of an automation effort, so minimal touches of the file are necessary. I am fairly new to SAS, so I apologize if this is a simple answer I missed or if it's just not possible.

Highlighted
Super Contributor
Posts: 391

Re: Save Excel workbook generated with SAS Add-In with today's date in the filename

Posted in reply to kbone1975

I think the easiest would be to create a VBA-script that refreshes the data and then save the file with the dynamic file name.

 

Use this code to connect top sas and refresh the data:

 

Dim sas As SASExcelAddIn

Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
sas.Refresh ThisWorkbook

 

//Fredrik

Ask a Question
Discussion stats
  • 1 reply
  • 146 views
  • 0 likes
  • 2 in conversation