ExpressionStore.Import
Use this method to import expressions from a file into the expression store.
Definition
Sub Import(bstrFileName As String)
Parameters
bstrFileName
[in] A String that contains the path and name of the file from which to import the expressions.
Return Values
None.
Error Values
This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
The following table shows the custom COM errors that this method can return.
Constant | Value | Description |
E_EXPR_BADCONNECTION | &H8110001F | Invalid connection |
E_EXPR_NOCONNECTIONSTRING | &H8110000D | No connection string specified |
E_EXPR_NONEMPTYSTORE | &H8110000C | Cannot import to a non-empty store |
Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
The expression store must be empty in order to import expressions.
The import file must contain the XML schema for the expression recordset followed by the XML representation of each expression recordset. Expression recordsets with invalid expression bodies are imported but will cause an error upon evaluation.
Use the Export method to copy the XML schema for the expression recordset and all the expressions from the expression store to a file.
Call the Connect method before calling the Import method.
Example
' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.
oExpressionStore.Import "\SomePath\Expressions.xml"