Function getXslProcessor(xslfile As String) As MSXML2.IXSLProcessor
Dim document As New MSXML2.FreeThreadedDOMDocument
document.async = False
document.Load (xslfile)
If (document.parseError.errorCode <> 0) Then
Err.Raise errorBaseValue + 10, "XSLProcessor.getXSLProcessor", "XML Document " & xslfile & " Invalid" & document.parseError.reason
End If
Dim xslt As New MSXML2.XSLTemplate
Set xslt.stylesheet = document
Dim processor As MSXML2.IXSLProcessor
Set processor = xslt.createProcessor
Set getXslProcessor = processor
End Function