Hi all,
I am currently trying to step through code for a Batch Job which moves files from one folder to another.
I am getting the error "Object Variable or With Block Variable not set" on the following line:
Set oTagAttributes = oNodeBirthDetails.Attributes
If anyone has experienced this error with Batch Jobs please let me know what ye did as I am totally stumped,The full code for this part is as follows:
Dim oNodeListBirthNot, oNodeListPerson, oNodeListPOB, oNodeListPDeath As MSXML2.IXMLDOMNodeList
Dim oNodeBirthDetails, oNodeChild, oNodeMother, oNodeFather As MSXML2.IXMLDOMNode
Dim oNodeGeneral, oNodePersonName, oNodeAddress, oNodePrevPregDetails As MSXML2.IXMLDOMNode
Dim oNodePDeath, oNodeHospital, oNodePlaceOfBirth As MSXML2.IXMLDOMNode
Dim oTagAttributes As MSXML2.IXMLDOMNamedNodeMap
Dim oXMLElement As MSXML2.IXMLDOMElement
Dim oAttribute As MSXML2.IXMLDOMAttribute
Set oNodeListPerson = oNotificationDoc.getElementsByTagName(g_cXML_Person)
Set oNodeListPOB = oNotificationDoc.getElementsByTagName(g_cXML_PlaceOfBirth)
Set oNodeListPDeath = oNotificationDoc.getElementsByTagName(g_cXML_PerinatalDeath)
Set oNodeListBirthNot = oNotificationDoc.getElementsByTagName(g_cXML_BirthRegistration)
Set oNodePlaceOfBirth = oNodeListPOB.Item(0)
Set oNodeChild = oNodeListPerson.Item(0)
Set oNodeMother = oNodeListPerson.Item(1)
Set oNodeFather = oNodeListPerson.Item(2)
Set oNodePDeath = oNodeListPDeath.Item(0)
Set oNodeBirthDetails = oNodeListBirthNot.Item(0)
Dim dictChildsDetails As Scripting.Dictionary
Set dictChildsDetails = CreateObject("Scripting.Dictionary")
Dim dictMothersDetails As Scripting.Dictionary
Set dictMothersDetails = CreateObject("Scripting.Dictionary")
Dim dictFathersDetails As Scripting.Dictionary
Set dictFathersDetails = CreateObject("Scripting.Dictionary")
Dim dictGenDetails As Scripting.Dictionary
Set dictGenDetails = CreateObject("Scripting.Dictionary")
Dim dictPeriNatalDetails As Scripting.Dictionary
Set dictPeriNatalDetails = CreateObject("Scripting.Dictionary")
'**************Doc Attributes***************
Set oNodeGeneral = oNotificationDoc.getElementsByTagName(g_cXML_MessageSourceID)
Set oXMLElement = oNodeGeneral(0)
sMessageSourceID = oXMLElement.nodeTypedValue
Set oNodeGeneral = oNotificationDoc.getElementsByTagName(g_cXML_MessageSource)
Set oXMLElement = oNodeGeneral(0)
sMessageSource = oXMLElement.nodeTypedValue
'**************Birth Attributes***************
Set oTagAttributes = oNodeBirthDetails.Attributes
sAction = IIf(oTagAttributes.getNamedItem(g_cXML_BirthRegistration_Action).nodeTypedValue = vbNullString, vbNullString, oTagAttributes.getNamedItem(g_cXML_BirthRegistration_Action).nodeTypedValue)
iSourceRef = IIf(oTagAttributes.getNamedItem(g_cXML_BirthRegistration_SourceRef).nodeTypedValue = vbNullString, -99, oTagAttributes.getNamedItem(g_cXML_BirthRegistration_SourceRef).nodeTypedValue)
If anyone has experienced this error with Batch Jobs please let me know what ye did as I am totally stumped,
Thanks a million,
Maggi
"Work is the curse of the drinking classes
I am currently trying to step through code for a Batch Job which moves files from one folder to another.
I am getting the error "Object Variable or With Block Variable not set" on the following line:
Set oTagAttributes = oNodeBirthDetails.Attributes
If anyone has experienced this error with Batch Jobs please let me know what ye did as I am totally stumped,The full code for this part is as follows:
Dim oNodeListBirthNot, oNodeListPerson, oNodeListPOB, oNodeListPDeath As MSXML2.IXMLDOMNodeList
Dim oNodeBirthDetails, oNodeChild, oNodeMother, oNodeFather As MSXML2.IXMLDOMNode
Dim oNodeGeneral, oNodePersonName, oNodeAddress, oNodePrevPregDetails As MSXML2.IXMLDOMNode
Dim oNodePDeath, oNodeHospital, oNodePlaceOfBirth As MSXML2.IXMLDOMNode
Dim oTagAttributes As MSXML2.IXMLDOMNamedNodeMap
Dim oXMLElement As MSXML2.IXMLDOMElement
Dim oAttribute As MSXML2.IXMLDOMAttribute
Set oNodeListPerson = oNotificationDoc.getElementsByTagName(g_cXML_Person)
Set oNodeListPOB = oNotificationDoc.getElementsByTagName(g_cXML_PlaceOfBirth)
Set oNodeListPDeath = oNotificationDoc.getElementsByTagName(g_cXML_PerinatalDeath)
Set oNodeListBirthNot = oNotificationDoc.getElementsByTagName(g_cXML_BirthRegistration)
Set oNodePlaceOfBirth = oNodeListPOB.Item(0)
Set oNodeChild = oNodeListPerson.Item(0)
Set oNodeMother = oNodeListPerson.Item(1)
Set oNodeFather = oNodeListPerson.Item(2)
Set oNodePDeath = oNodeListPDeath.Item(0)
Set oNodeBirthDetails = oNodeListBirthNot.Item(0)
Dim dictChildsDetails As Scripting.Dictionary
Set dictChildsDetails = CreateObject("Scripting.Dictionary")
Dim dictMothersDetails As Scripting.Dictionary
Set dictMothersDetails = CreateObject("Scripting.Dictionary")
Dim dictFathersDetails As Scripting.Dictionary
Set dictFathersDetails = CreateObject("Scripting.Dictionary")
Dim dictGenDetails As Scripting.Dictionary
Set dictGenDetails = CreateObject("Scripting.Dictionary")
Dim dictPeriNatalDetails As Scripting.Dictionary
Set dictPeriNatalDetails = CreateObject("Scripting.Dictionary")
'**************Doc Attributes***************
Set oNodeGeneral = oNotificationDoc.getElementsByTagName(g_cXML_MessageSourceID)
Set oXMLElement = oNodeGeneral(0)
sMessageSourceID = oXMLElement.nodeTypedValue
Set oNodeGeneral = oNotificationDoc.getElementsByTagName(g_cXML_MessageSource)
Set oXMLElement = oNodeGeneral(0)
sMessageSource = oXMLElement.nodeTypedValue
'**************Birth Attributes***************
Set oTagAttributes = oNodeBirthDetails.Attributes
sAction = IIf(oTagAttributes.getNamedItem(g_cXML_BirthRegistration_Action).nodeTypedValue = vbNullString, vbNullString, oTagAttributes.getNamedItem(g_cXML_BirthRegistration_Action).nodeTypedValue)
iSourceRef = IIf(oTagAttributes.getNamedItem(g_cXML_BirthRegistration_SourceRef).nodeTypedValue = vbNullString, -99, oTagAttributes.getNamedItem(g_cXML_BirthRegistration_SourceRef).nodeTypedValue)
If anyone has experienced this error with Batch Jobs please let me know what ye did as I am totally stumped,
Thanks a million,
Maggi
"Work is the curse of the drinking classes