The Schedule task in SAS Add-In for Microsoft Office creates a VBScript file that Windows Task Scheduler uses to execute a refresh on a specified schedule. The VBScript created by the SAS Add-In for Microsoft Office is saved in C:\Users\<your-user-id>\Documents\My SAS Files\Add-In for Microsoft Office. To successfully schedule a refresh in the SAS Add-In for Microsoft Office, follow these guidelines:
- The recommended and default Windows Task Scheduler security setting for scheduling a refresh in the SAS Add-In for Microsoft Office is Run only when user is logged on.
- The Windows user must be able to use Windows Task Scheduler and execute VBScript programs independently of SAS Add-In for Microsoft Office.
- Metadata credentials must be cached in the SAS Add-In for Microsoft Office user's connection profile. To see this information, navigate to Tools ► Connections. Choose the active server and click Modify. Make sure that the Save login in profile option is checked and that the selection persists. If it does not persist, contact your SAS metadata administrator and request the ability to cache metadata credentials.
- A scheduled refresh does not execute if the SAS Add-In for Microsoft Office file is open. Ensure that you have saved and closed the file before it is scheduled to execute.
- The SAS Add-In for Microsoft Office file must be saved to your local computer.
- SAS Add-In for Microsoft Office must be installed on the machine where the VBScript file is scheduled to execute.
- The refresh must execute successfully from VBScript outside of Windows Task Scheduler. Execute the VBScript outside of Windows Task Scheduler to verify that the project runs successfully in batch.
Suggestions for using Run whether user is logged on or not:
- Use of this security context depends on Windows settings, not SAS Add-In for Microsoft Office settings. Because these settings vary based on company security policies, it is often difficult to use this Task Scheduler security context. For example, it might be allowed due to company restrictions.
- The Windows user ID that is used to schedule the project must have Local Administration rights and the Log on as a batch job privilege.
- You might need to open your Microsoft Office document using Run as Administrator before using the Schedule task. Windows 8 and later operating systems do not open applications using Administrator privileges by default. Because Run whether user is logged on or not requires Administrator privileges, Microsoft Office must be opened with elevated Admin rights.
- The project and VBScript must be saved to your local computer (not a network drive or SharePoint, and so on) to use the Run whether user is logged on or not security option.
- To use the Run whether user is logged on or not Task Scheduler security context, deselect Run only if logged on on the SAS Add-In Scheduled Refresh dialog box.

- Open the newly scheduled job in Windows Task Scheduler. View the scheduled job's properties. On the General tab, deselect the option Do not store password. The Run with Highest Privileges option might or might not be needed. Test with this option selected and without it selected.
- On the General tab of the scheduled job in Task Scheduler, select Windows Server 2003, Windows XP, or Windows 2000 for the Configure for option.

- For a refresh to Run whether user is logged on or not, it is likely necessary to copy the MetadataServerProfiles folder from %appdata%\SAS\ folder into the C:\Windows\System32\config\systemprofile\AppData\Roaming\SAS\ folder and the C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\SAS\ folder.
- For access to network resources when Run whether user is logged on or not is selected, the Windows local security option "Network access: Do not allow storage of passwords and credentials for network authentication" must be disabled.
- If the user is logged off, Microsoft Excel might display errors when it is automated via the Windows Task Scheduler. This problem is not specific to scheduling Excel files that contain SAS content. If this occurs, it might be necessary to create Desktop folders in the \config\systemprofile directories. (Note: The Desktop folders must have an uppercase D. Capitalization matters.)