Hi
My expectation is to do some reverse engineering, creating an XML map from an XML file...
I have seen that it was possible to realize that operation directly using vba code in excel
I have been using a piece of code offered per MS for that purpose at http://msdn.microsoft.com/en-us/libr...tCreateCommand
Yesterday it works but this morning it produces an automation error !!! while the XML source file is the same!
Hereunder is the MS code (slightly modified) I am using
It is blocking at the line < Set MyMap = ThisWorkbook.XmlMaps.Add(StrMyXml) >
Sub Create_XSD2()
Dim StrMyXml As String
Dim MyMap As XmlMap
Dim anyMap As XmlMap
Dim StrMySchema As String
' Book.xml is the file created in section one of this topic.
StrMyXml = "mySQE_exportLocCh.xml"
' Turn off async loading.
Application.DisplayAlerts = False
' Add the string to the XmlMaps collection.
For Each anyMap In ThisWorkbook.XmlMaps
anyMap.Delete
Next
Set MyMap = ThisWorkbook.XmlMaps.Add(StrMyXml)
Application.DisplayAlerts = True
' Create an empty file and output the schema.
StrMySchema = ThisWorkbook.XmlMaps(1).Schemas(1).XML
Open "mySQE_exportLocCh.xsd" For Output As #1
Print #1, StrMySchema
Close #1
End Sub
Any idea of what could suddenly prevent this code from working ?
Regards
Alain
Bookmarks