Class XmlNamespaces (Excel VBA)

The class XmlNamespaces represents the collection of XmlNamespace objects in a workbook. To use a XmlNamespaces class variable it first needs to be instantiated, for example


Dim xns as XmlNamespaces
Set xns = ActiveWorkbook.XmlNamespaces

For Each

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


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

Count

Returns a Long value that represents the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveWorkbook.XmlNamespaces.Count

InstallManifest

Installs the specified XML expansion pack on the user's computer, making an XML smart document solution available to one or more users.

For security purposes, you cannot install an unsigned manifest. For more information about manifests, see the Smart Document Software Development Kit (SDK).

InstallManifest (Path, InstallForAllUsers)


Application.XMLNamespaces.InstallManifest _ 
 "https://smartdocuments/simplesample/manifest.xml"

Arguments

The following argument is required

Path (String) - The path and file name of the XML expansion pack.

Optional arguments

The following argument is optional

InstallForAllUsers - True installs the XML expansion pack and makes it available to all users on a machine. False makes the XML expansion pack available for the current user only. The default is False

Item

Returns a single XmlNamespace object from the collection.

Item (Index)

Index: The name or index number of the object.


Dim xmlnspItem As XmlNamespace
Set xmlnspItem = ActiveWorkbook.XmlNamespaces(Index:=1)

Value

Returns a String value that represents the XML namespaces that have been added to the workbook.

If the workbook contains more than one namespace, the namespaces are separated by a blank space in the string returned by the Value property.


Dim strValue As String
strValue = ActiveWorkbook.XmlNamespaces.Value