Quote:
How do I fix object reference not set to an instance of an object error?
If you expect
aobjXMLInputDoc.DocumentElement.SelectSingleNode("Case/Case/SecurityGroup/@Word").InnerText
to fail because the node is optional, you need to check if the variable holding the result is still a string or NULL. if the variable is NULL, set a default value.
strCaseSecurityGroupCodeWord = aobjXMLInputDoc.DocumentElement.SelectSingleNode("Case/Case/SecurityGroup/@Word").InnerText
if strCaseSecurityGroupCodeWord = NULL then
...
end if