BookmarkSubscribeRSS Feed
kbone1975
Fluorite | Level 6

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.

1 REPLY 1
FredrikE
Rhodochrosite | Level 12

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 1 reply
  • 717 views
  • 0 likes
  • 2 in conversation