I'm using MSXML4.0 and have a question about testing the return value of some functions. I'm using XPath as my selection langauges so I frequently attempt to retrieve nodes using:
Dim Node As IXMLDOMNode
node = XMLDoc.selectSingleNode("/foo/bar")
What I would like to do is test the value of the node to ensure it is valid before calling methods on it. The documentation for selectSingleNode says the return value is Nothing if no node is found to match the XPath expression. I tried the following:
If Node = Nothing Then
but I got the following error:
Invalid Use of Object
How can I test the validity of my object in this case?
Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!
Here are a few simple, working, games that you can use as-is or as the basis for your own games.
This is one of the simplest of all games.
The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…