I am trying to gather a piece of data from an XML file and am getting all sorts of errors. Here is my function to grab the piece I need. I just need one piece from the XML and that is "diagCd". I am getting errors saying object required on the Set Node line and then I'm getting "expected '='" on the Set xmlDoc line when I separate it out. I am just trying to read the XML and save diagCd to the variable DX1.

Code:
    Function DX1ToUnet(DX1, sUser, FileExists, CurrentVersion)
Set objXMLDoc = Createobject("Microsoft.XMLDOM")
       Dim Node

'objXMLDoc = CreateObject("Microsoft.XMLDOM") 
objXMLDoc.load("C:\Documents and Settings\" & sUser & "\Local Settings\Application Data\" & CurrentVersion & "\temp.xml")
objXMLDoc.load("temp.xml")
Set Node = objXMLDoc.documentElement.selectSingleNode("diagCd")
DX1 = Node.Text 
 
msgbox DX1

End Function