VB Code:
Public Sub LoadFile(strTargetFile As String)
'***************************************************************************
'Purpose: Perform actions necessary to load the target xml file
'Inputs: strTargetFile - The name of the xml file to be opened.
'Outputs: None
'***************************************************************************
Dim lngIndex As Long
On Error GoTo ErrorRoutine
XMLdoc.async = False
XMLdoc.validateOnParse = False
XMLdoc.preserveWhiteSpace = False
XMLdoc.Load strTargetFile
If XMLdoc.parseError.errorCode = 0 Then
If XMLdoc.readyState = 4 Then
' It's OK
'AddNodeToTree XMLdoc.documentElement
End If
Else
Err.Description = XMLdoc.parseError.reason & vbCrLf & _
"Line: " & XMLdoc.parseError.Line & vbCrLf & _
"XML: " & XMLdoc.parseError.srcText
Err.Raise 1006
End If
Exit Sub
ErrorRoutine:
' You would have your own error display here
'DisplayError "LoadFile"
End Sub