| ||Application.Run("OCSetConnection", DataFolderPath, OperatorID, Password, AutoRefresh)|
|DataFolderPath||Optional. The full path to the data folder. You will be prompted to select a data folder prior to refreshing if this argument is left blank or is invalid.|
|OperatorID||Optional. A valid Timberline operator ID. You will be prompted for login credentials if this value is blank or invalid.|
|Password||Optional. The password associated with the Timberline operator ID. You will be prompted for login credentials if this value is blank or invalid.|
|AutoRefresh||Optional. Pass True to force the workbook to refresh when you call this macro. The default is False.|
The OCSetConnection macro can be used to
The typical scenario involves calling this macro in the Workbook_Open event under the ThisWorkbook object.
- Automatically refresh your workbook when it is opened.
- Support a manual refresh, but without the need to select the data folder or supply your operator ID and password.
- Automatically refresh your workbook as part of an unattended, scheduled refresh in conjunction with Windows Task Scheduler.
Call Application.Run("OCSetConnection", "D:\TSDATA\MyFolder", "pat", "password", True)
|Note -||Protect the VBA project with a password to prevent others from discovering your Timberline Operator ID and password.|