<< Click to Display Table of Contents >>
Load |
Load(Configuration, [ConfigStatus], [ErrorDetails])
Loads a configuration saved by the Save method in the Configuration parameter. This method returns True if the loading operation was successful or False otherwise. The optional return parameter ConfigStatus indicates the result of that loading operation. If this method returns True, that is, the operation was successful, this parameter returns the value 0: Configuration successfully loaded. If this method returns False, that is, the operation was not successful, this parameter returns values 1: Configuration did not load successfully, 2: Configuration content is invalid, or 3: Configuration requires a newer version. The optional return parameter ErrorDetails contains a String with details about the error occurred during that loading operation. The next code contains an example of usage for this method.
Set TA = Application.GetTrendAnalysis("TrendAnalysis")
Dim loadResult, errorMsg, errorDetails
loadResult = TA.Load(Screen.Item("TextBox3").Value, ConfigStatus, errorDetails)
If loadResult = False Then
If ConfigStatus <> 0 Then
Select Case ConfigStatus
Case 1
errorMsg = "Error (1): Configuration did not load successfully."
Case 2
errorMsg = "Error (2): Configuration content is invalid."
Case 3
errorMsg = "Error (3): Configuration requires a newer version."
End Select
errorMsg = errorMsg & vbCrLf & "Details: " & errorDetails
MsgBox errorMsg
End If
Else
TA.Show
End If
NOTE |
Using the Show method in a TrendAnalysis object whose configuration loading was not successful only displays a blank window. |