I am trying to return a value from my code. It’s much easier to just show the code:
Function writeHeaderData() As IXMLDOMNode
Dim xmlDoc As New MSXML2.DOMDocument30
xmlDoc.async = False
xmlDoc.LoadXML "<Foo></Foo>"
Dim Foo As IXMLDOMNode
Set Foo = xmlDoc.DocumentElement
'code snip; includes appending lots of things to Foo
'the error is on this line:
writeHeaderData = Foo
Exit Function
End Function
I already searched Google, but it was useless. This function is called from the main routine, and I'm trying to add the returned IXMLDOMNode to a larger one, but I keep getting an error "Object variable or With block variable not setin the line writeHeaderData = Foo. What is here?
source
share