Results 1 to 3 of 3

Problem in Creating an XML Mapping Schema using Excel 2010

Threaded View

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    France
    MS-Off Ver
    Excel 2013 and 2010 and 2007 and 2003
    Posts
    4

    Problem in Creating an XML Mapping Schema using Excel 2010

    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
    Last edited by arlu1201; 08-08-2013 at 01:29 AM. Reason: Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. XMLl file - Mapping / Schema questions
    By Scott K in forum Excel General
    Replies: 0
    Last Post: 07-19-2013, 07:46 PM
  2. Replies: 1
    Last Post: 04-16-2011, 09:47 PM
  3. XML Schema problem
    By sajidsaiyed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2006, 04:00 AM
  4. Mapping Worksheet - XML Schema
    By Dave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2005, 10:05 AM
  5. [SOLVED] Programmatic schema mapping, XPath.SetValue question
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2005, 06:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1