title: EXCEL, create a XML-file from a data in table via vba code
body: <p><b>EXCEL</b></p>
  
  <p>The file luxom2xlm is available at <a href="https://www.dropbox.com/sh/f3dd2aby8wxpn5x/AAAOqaUV9LvtgrNghMT71AkHa?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/sh/f3dd2aby8wxpn5x/AAAOqaUV9LvtgrNghMT71AkHa?dl=0</a></p>
  
  <p>There are also screenshots (because I'm not allowed to insert pictures in it, I do not have 10 reputations ...  correction it seems that I was wrong)</p>
  
  <p><a href="https://www.dropbox.com/s/6vr30uydv9kmgqq/EXCEL_luxom_macro.PNG?dl=0" rel="nofollow noreferrer">vba code to create a XML - https://www.dropbox.com/s/6vr30uydv9kmgqq/EXCEL_luxom_macro.PNG?dl=0</a></p>
  
  <p><a href="https://www.dropbox.com/s/mnpaurktpj39o21/EXCEL_luxom_columns.PNG?dl=0" rel="nofollow noreferrer">formula doesn't work "inconsistent error" in excel2013- https://www.dropbox.com/s/mnpaurktpj39o21/EXCEL_luxom_columns.PNG?dl=0</a></p>
  
  <p>(Unfortunately I just allowed to ask one question a day, so I'll open tomorrow a new question 
  ...)
  (not the best solution for solving inconsistent problems but it is the only one I found till now - see comment) </p>
  
  <p><b>1. vba code : to create XML file</b></p>
  
  <p>I try to figure out 'how' to make macro to extract the data directly from a table and create a XML file and validate it via a XSD-file.
  Manually it work fines, so I've recorded vba code.</p>
  
  <p>But unfortunately this seem not to work.</p>
  
  <pre><code>' REF VBA   - http://www.globaliconnect.com/excel/index.php?option=com_content&amp;view=article&amp;id=162:excel-vba-calling-sub-procedures-a-functions-placement-in-modules&amp;catid=79&amp;Itemid=475
  '     EXCEL - http://excelcentral.com
  
  Sub Export2XML()
  '
  ' export2XML Macro
  '
  '  REF : http://office.microsoft.com/en-gb/excel-help/export-xml-data-HP010206401.aspx
  '
  
  '
      Path_Name = Sheets("info").Range("c21").Value ' Path_Name = E:\luxom.xml
  
      'work sheet luxom_input
      Sheets("luxom_input").Select
  
      'where Luxom__Elements_In_Output_Map is the root element of the XSD-file
      'which is used as reference
  
      'method 1 created via a record macro doesn't work
      ActiveWorkbook.XmlMaps("Luxom__Elements_In_Output_Map").export URL:= _
          "E:\luxom.xml"
  
      'method 2 
      ActiveWorkbook.XmlMaps("Luxom__Elements_In_Output_Map").export URL:= _
          Path_Name
  End Sub
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/KJq89.png" alt="I would like to make it dynamicaly, that is why I&#39;ve entered "></p>
  
  <p><b>2. TABLE : formula not working INCONSISTENT ERROR </b>
  (the solution I found - see comment)</p>
  
  <p>The formula worked fine in EXCEL2010, and in EXCEL2013 re-typed and recognised also but now I get an error
  <img src="https://i.stack.imgur.com/0uqK7.png" alt="formula"> </p>
  
  <p>Neither the help from microsoft solved my problem </p>
  
  <p><a href="http://office.microsoft.com/en-ca/mac-excel-help/correct-an-inconsistent-formula-HA102927556.aspx" rel="nofollow noreferrer">http://office.microsoft.com/en-ca/mac-excel-help/correct-an-inconsistent-formula-HA102927556.aspx</a></p>
  
  <p>Sheet "luxom_input", table "T_LuxomInput",</p>
  
  <ul>
  <li><p>in column "O - ID" (address = a fixed stringformat)</p>
  
  <p><code>=CONCATENATE([@[networkID]] ;address; [@[groupID]] ;address; TEXT([@[HexAddress]];"00"))</code></p></li>
  <li><p>in column "O - KAST"</p>
  
  <p><code>=IF(AND(IFERROR(FIND(start_02;MID([@Name];1;1))&gt;0;0);MID([@Name];2;1)&lt;(CHAR(CODE(9)+1)));MID([@Name];2;1);"")</code></p></li>
  </ul>
  
  <p>Has somebody an idea to make it working ...</p>
  
  <p>You may have to change <code>;</code> to <code>,</code> and <code>,</code> to <code>.</code> according to your local.</p>