Class XmlNamespace (Excel VBA)

The class XmlNamespace represents a namespace that has been added to a workbook. To use a XmlNamespace class variable it first needs to be instantiated, for example


Dim xmlnsp as XmlNamespace
Set xmlnsp = ActiveWorkbook.XmlNamespaces(Index:=1)

For Each

Here is an example of processing the XmlNamespace items in a collection.


Dim xmlnsp As XmlNamespace
For Each xmlnsp In ActiveWorkbook.XmlNamespaces
	
Next xmlnsp

Prefix

Returns a String that represents the prefix for the specified XML namespace.


Dim strPrefix As String
strPrefix = ActiveWorkbook.XmlNamespaces(1).Prefix

Uri

Returns a String that represents the Uniform Resource Identifier (URI) for the specified XML namespace.


Dim strUri As String
strUri = ActiveWorkbook.XmlNamespaces(1).Uri