Quote:
How do I fix this so it works whether or not the CompDate element exist in the XML Document?
Rather simple, either you check that element exist before reading its value, either you read the value to a temp variable and the check if variable is expected object or nothing before storing value.
Should like that:
Tmp= CDate(aobjXmlInputDoc.DocumentElement.SelectSingleNode("Case/CaseEvent[@ID=" + strEventId + "]/CompDate").InnerText)
If Tmp Is Nothing Then objInsertPWBRorAOS.CompletedDate = Tmp