Я установил на свой компьютер MSXML 2.6 MSXML 3.0 MSXML 4.0 MSXML 6.0
, когда я пытаюсь проанализировать мой XSL во время выполнения, у меня появляется ошибка Invalid Class String, это код
Public Sub PreviewDOCUMENT()
Dim ObjXMLTransformDoc
Dim ObjXMLTransformStyle
Dim ObjXMLDoc
Dim ObjXMLStyle
Dim ObjXsltSettings
On Error GoTo ERR_HANDLER
If mResultPath <> "" Then
Set ObjXMLTransformDoc = CreateObject("Msxml2.DOMDocument.4.0")
ObjXMLTransformDoc.Load (mResultPath & MyDocument.DOC_TYPE & "_XML_TO_XSL.xml")
Set ObjXMLTransformStyle = CreateObject("Msxml2.DOMDocument.4.0")
ObjXMLTransformStyle.Load ActiveWorkbook.path & "\RESULT\form_generation.xsl"
ObjXMLTransformStyle.setProperty "AllowXsltScript", True
Set ObjXMLStyle = CreateObject("Msxml2.DOMDocument.4.0")
ObjXMLTransformDoc.transformNodetoObject ObjXMLTransformStyle, ObjXMLStyle
KillFile mResultPath & MyDocument.DOC_TYPE & "_DOCUMENT_STYLE.xsl"
DoEvents
AppendToTextFile mResultPath & MyDocument.DOC_TYPE & "_DOCUMENT_STYLE.xsl", ObjXMLStyle.XML
Dim mSE As New CShellExecute
mSE.LaunchDocument 0, mResultPath & MyDocument.DOC_TYPE & "_XML_TO_XML.xml", ActiveWorkbook.path & "\RESULT\", sesSW_SHOWDEFAULT
Else
MsgBox "Create documents first!"
End If
Exit Sub
ERR_HANDLER:
MsgBox "Error: " & Err.Number & ". " & Err.Description
End Sub