Applying a Stylesheet to an ADO XML Document and Importing It to Access : XML Transformed « XML « VBA / Excel / Access / Word






Applying a Stylesheet to an ADO XML Document and Importing It to Access

 
Sub ApplyStyleSheetAndImport() 
    Dim myXMLDoc As New MSXML2.DOMDocument50 
    Dim myXSLDoc As New MSXML2.DOMDocument50 
    Dim newXMLDoc As New MSXML2.DOMDocument50 

    myXMLDoc.async = False 
    If myXMLDoc.Load("C:\data.xml") Then 
        myXSLDoc.Load "C:\trans.xsl" 

        If Not myXSLDoc Is Nothing Then 
            myXMLDoc.transformNodeToObject myXSLDoc, newXMLDoc 
            newXMLDoc.Save "C:\Converted.xml" 
            Application.ImportXML "C:\Converted.xml" 
        End If 
     End If 
    Set myXMLDoc = Nothing 
    Set myXSLDoc = Nothing 
    Set newXMLDoc = Nothing 
End Sub 

 








Related examples in the same category