I think i know why .... you are using wrong object. Instead of using the objDoc
, you need to set this into a Node
and then retrieve the value. Something like the below
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.SetProperty "SelectionLanguage", "XPath"
xmlDoc.Async = False
xmlDoc.Load("C:\Users\Pankaj\Desktop\test.xml")
Set nodeXML = xmlDoc.SelectSingleNode("//ProfileSettings/Form[@name='frmViewMailMessages']/Control[@name='subMailMessages']/Height")
msgbox nodeXML.Text