SAS Manage Content Refresh via Windows Task Scheduler

Truelie

New member
Joined
Apr 13, 2016
Messages
3
Reaction score
0
Points
0
Hi,

I am having the excel workbooks embedded with the SAS Datasets using the SAS Addin.

Currently, I'm manually opening the Excel report which is embedded with SAS Datasets and in the menu bar

SAS - > Manage Content -> Refresh

It will refresh all the datasets inside the workbook.

Am trying to automate this process using VBA and it is working fine when i was running it via Visual Basic Editor.

But whenever i schedule this process, the VBA fails by throwing the Error message in the below line of code,

Sub Test()
Dim WB As Workbook
Dim SAS As SASExcelAddIn
Dim SName As String

Application.ScreenUpdating = False
' To Refresh the SAS Datasets attached in excel
Set SAS = ThisWorkbook.Application.COMAddIns.Item("SAS.ExcelAddIn").Object
SAS.Refresh

End Sub
 

Attachments

  • sas_refresh.png
    sas_refresh.png
    4.4 KB · Views: 21
Back
Top