Soucis d'actualisation de mapping XML en VBA

Bonjour à tous,

Je suis confronté à un problème un peu complexe, donc je pense que ce sujet concernera les personnes les plus avisées en la matière.

Mon fichier Excel étant trop volumineux je vais expliquer un peu plus le contexte avec des screenshots.

J'ai un dossier qui comporte plus de 1000 fichiers texte qui sont générés après le fonctionnement d'une machine. Ces textes sont sous écritures XML et j'ai déjà récupérer une macro faisant le mapping idéal la dessus.

capture4

Le but de ma macro est d'ouvrir chacun des fichiers (en l'occurrence ceux qui commencent par 450) pour appliquer ce mapping XML et récupérer les données de manière propre dans mon fichier excel pour en tirer un tableau.

capture

Ma macro va bien chercher tous les fichiers dans le dossier et les ouvre 1 par 1 jusqu'au dernier mais le problème est que lors du redémarrage de ma session ou de la réouverture de l'excel, elle va rester bloquée sur le tout dernier fichier ouvert (par ex: 450999) et ne va plus appliquer le mapping XML alors que ma variable Fichier indique bien que c'est tel ou tel fichier qui est sélectionné.

Comme vous pouvez le voir sur la capture du dessus, les fichiers sont bien ouverts dans l'odre décroissant des 450.

Maintenant si je relance ma macro apres avoir fermé le fichier, voila ce que ca donne:

Ca c'est le dernier fichier ouvert par le mapping XML

capture2

Et donc tous les fichiers suivants sont identiques (alors que ma variables fichiers reboucle bien sur les 450001, 450002, 450003 etc...

capture3

Une solution pour que cela fonctionne normalement consiste a ouvrir un fichier manuellement pour en quelques sorte "reset" la macro et apres tout fonctionne normalement comme dans le 2e screen. Mais j'aimerai bien que dés l'ouverture du fichier celui ci puisse charger tous les fichiers sans rester bloqué sur le dernier ouvert (car j'aimerai automatiser le code dés l'ouverture du fichier).

Je vous colle le code pour que vous puissiez "visualiser" ce que j'essaie de vous décrire. Je suis conscient que le problème n'est pas commun et qui je pense ne doit pas être facilement compréhensible pour tout le monde. Mais je vous serai très reconnaissant si l'un d'entre vous peut trouver une solution.

Enfin bref, n'hesitez pas à me redemander plus de détails si le probleme vous intéresse.

Je vous remercie pour votre attention et en espérant une réponse, bonne journée à tous!

Sub ListingFichiers()

'par Excel-Malin.com ( https://excel-malin.com )
On Error GoTo Erreur

'stocker le moment de début
MacroDebut = Now

Sheets("DataBase").Select

' Nettoie les cases excel

' ClearContents

 Application.Calculation = xlManual
 Application.ScreenUpdating = False

   Sheets("Données Calcul").Range("L:L").ClearContents
   Sheets("DataBase").Range("A5:AE5000").ClearContents

' Définition des variables

    Dim Chemin As String, Fichier As String
    Dim i As Integer
    Dim Value As Variant
    Dim k As Integer
    'Dim oCell As Range
    Dim sup As Integer
    Dim l, m, n As Integer

    Sheets("DataBase").Select
    l = Application.WorksheetFunction.CountA(Range("B:B"))

 i = 1
    'Définit le répertoire contenant les fichiers
    Chemin = "S:\DQ\Partage\Public SONACA\30-Traitements thermiques\BASE DE DONNEES\03_COMPOSITE-GOSS\ATL MTORRES\programs\ph\"

    Fichier = Dir(Chemin & "*450**.summary")

        Do While Fichier <> ""

    ' MACRO POUR CHARGER UNIQUEMENT LES NOUVEAUX FICHIERS

     Sheets("Summary").Select

    'Dim fn As Variant
     'fn = Application.GetOpenFilename("*450**.summary*", "Summary,*.summary", "Select One Summary File To Open", , False)
   ' If TypeName(fn) = "Boolean" Then Exit Sub

    On Error Resume Next

     ActiveWorkbook.XmlMaps("Reports_Map").Import URL:=Fichier

     'extract

     '

' Extract Macro
'

Sheets("DataBase").Select

  k = Application.WorksheetFunction.CountA(Range("B:B"))

Dim rg As Range
Dim q As Integer

Sheets("Données Calcul").Select
q = Application.WorksheetFunction.CountA(Range("L:L"))

Set rg = Sheets("Données Calcul").Range(Cells(1, 12), Cells((q + 1), 12)).Find(Fichier)
If rg Is Nothing Then

Sheets("DataBase").Select

ICI SE TROUVE LE CODE POUR L'EXTRACTION DES DONNEES DE CHAQUES PROGRAMME

Sheets("Données Calcul").Select
    Sheets("Données Calcul").Range("L" & (q + 1)) = Fichier

     Else
     'i = i - 1
     sup = sup + 1

      Sheets("Données Calcul").Select
    Sheets("Données Calcul").Range("L" & (q + 1)) = Fichier

     End If

      i = i + 1

     Fichier = Dir

     Else: Fichier = Dir
     End If

    Loop

    'i = 0

   Sheets("DataBase").Select
   m = Application.WorksheetFunction.CountA(Range("B:B"))
   n = m - l

    Sheets("DataBase").Calculate

     Columns("A:A").Select
       Selection.NumberFormat = "General"
     Columns("AA:AC").Select
       Selection.NumberFormat = "General"

     Range("B3:G3,I3:M3").Select
    Range("I3").Activate
    Range("B3:G3,I3:M3,O3:Q3").Select
    Range("O3").Activate
    Range("B3:G3,I3:M3,O3:Q3,T3:Z3").Select
    Range("T3").Activate
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Selection.Merge
    Range("B3:G3").Select
    ActiveCell.FormulaR1C1 = "Résumé programme, date et heure"
    Range("I3:M3").Select
    ActiveCell.FormulaR1C1 = "Résumé des temps"
    Range("O3:Q3").Select
    ActiveCell.FormulaR1C1 = "Résumé matière"
    Range("T3:Z3").Select
    ActiveCell.FormulaR1C1 = "Résumé du temps ""running"""
    Range("T3:Z3,O3:Q3,I3:M3,B3:G3").Select
    Range("B3").Activate
    With Selection.Font
        .Name = "Calibri"
        .Size = 18
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontMinor
    End With
    Selection.Font.Bold = True
    With Selection.Font
        .ThemeColor = xlThemeColorLight2
        .TintAndShade = 0.399975585192419
    End With
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent1
        .TintAndShade = 0.799981688894314
        .PatternTintAndShade = 0
    End With

    ActiveSheet.ListObjects("Tableau22").Resize Range(Cells(4, 2), Cells((k + 3), 30))

    Range("A1").Select

    Application.Calculation = xlAutomatic

    Application.ScreenUpdating = True

     Sheets("Summary").Select

    'ActiveWorkbook.XmlMaps("Reports_Map").Import URL:="450000.2017-01-09 08-39-48.summary"

'comparer le début & la fin et afficher le résultat
MsgBox "Durée d'exécution: " & Format(Now - MacroDebut, "hh:mm:ss")
MsgBox (n & " programme(s) ont été ajouté")

Exit Sub

Erreur:
MsgBox "Une erreur est survenue..."

End Sub

Bonjour,

Mieux vaut éviter les ".Select"

Sans fichier XML, c'est compliqué, mais à essayer le code suivant en mode débogage (F8)

Sub ListingFichiers()
  Stop    ' Permet de suivre le déroulement de la macro avec F8
  ' Définition des variables
  Dim Chemin As String, Fichier As String
  Dim i, K, l, m, n, q As Long
  Dim Value As Variant
  Dim sup As Integer
  Dim rg As Range
  Dim MacroDebut As Variant
  'par Excel-Malin.com ( https://excel-malin.com )
  On Error GoTo Erreur
  'stocker le moment de début
  MacroDebut = Now
  ' Nettoie les cases excel
  ' ClearContents
  Application.Calculation = xlManual
  Application.ScreenUpdating = False
  Sheets("Données Calcul").Range("L:L").ClearContents
  Sheets("DataBase").Range("A5:AE" & Rows.Count).ClearContents
  'Sheets("DataBase").Select = INUTILE
  l = Application.WorksheetFunction.CountA(Range("B:B"))
  i = 1
  'Définit le répertoire contenant les fichiers
  Chemin = "S:\DQ\Partage\Public SONACA\30-Traitements thermiques\BASE DE DONNEES\03_COMPOSITE-GOSS\ATL MTORRES\programs\ph\"
  Fichier = Dir(Chemin & "*450**.summary")
  Do While Fichier <> ""
    ' MACRO POUR CHARGER UNIQUEMENT LES NOUVEAUX FICHIERS
    'Dim fn As Variant
    'fn = Application.GetOpenFilename("*450**.summary*", "Summary,*.summary", "Select One Summary File To Open", , False)
    ' If TypeName(fn) = "Boolean" Then Exit Sub
    On Error Resume Next
    ActiveWorkbook.XmlMaps("Reports_Map").Import Url:=Fichier
    'extract
    K = Application.WorksheetFunction.CountA(Sheets("DataBase").Range("B:B"))
    q = Application.WorksheetFunction.CountA(Sheets("Données Calcul").Range("L:L"))
    Set rg = Sheets("Données Calcul").Range(Cells(1, 12), Cells((q + 1), 12)).Find(Fichier)
    If rg Is Nothing Then
      ' ICI SE TROUVE LE CODE POUR L'EXTRACTION DES DONNEES DE CHAQUES PROGRAMME
      Sheets("Données Calcul").Range("L" & (q + 1)) = Fichier
    Else
      'i = i - 1
      sup = sup + 1
      Sheets("Données Calcul").Range("L" & (q + 1)) = Fichier
    End If
    i = i + 1
    Fichier = Dir
  Loop
  'i = 0
  m = Application.WorksheetFunction.CountA(Sheets("DataBase").Range("B:B"))
  n = m - l
  With Sheets("DataBase")
    .Calculate
    .Columns("A:A").NumberFormat = "General"
    .Columns("AA:AC").NumberFormat = "General"
    With .Range("B3:G3,I3:M3,O3:Q3,T3:Z3")
      .HorizontalAlignment = xlCenter
      .VerticalAlignment = xlBottom
      .WrapText = False
      .Orientation = 0
      .AddIndent = False
      .IndentLevel = 0
      .ShrinkToFit = False
      .ReadingOrder = xlContext
      .MergeCells = False
    End With
    .Range("B3:G3").FormulaLocal = "Résumé programme, date et heure"
    .Range("I3:M3").FormulaLocal = "Résumé des temps"
    .Range("O3:Q3").FormulaLocal = "Résumé matière"
    .Range("T3:Z3").FormulaLocal = "Résumé du temps ""running"""
    With .Range("T3:Z3,O3:Q3,I3:M3,B3:G3")
      With .Font
        .Name = "Calibri"
        .Size = 18
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontMinor
        .Bold = True
      End With
      .ThemeColor = xlThemeColorLight2
      .TintAndShade = 0.399975585192419
      With .Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent1
        .TintAndShade = 0.799981688894314
        .PatternTintAndShade = 0
      End With
    End With
  End With
  ActiveSheet.ListObjects("Tableau22").Resize Range(Cells(4, 2), Cells((K + 3), 30))
  Range("A1").Select
  Application.Calculation = xlAutomatic
  Application.ScreenUpdating = True
  Sheets("Summary").Select
  'ActiveWorkbook.XmlMaps("Reports_Map").Import URL:="450000.2017-01-09 08-39-48.summary"
  'comparer le début & la fin et afficher le résultat
  MsgBox "Durée d'exécution: " & Format(Now - MacroDebut, "hh:mm:ss")
  MsgBox (n & " programme(s) ont été ajouté")
  Exit Sub

Erreur:
  MsgBox "Une erreur est survenue..."
End Sub

A+

Bonjour,

Merci pour votre réponse mais idem, toujours le même problème. Lors du lancement de Excel pour la premiere fois, il n'arrive plus a faire le mapping XML et url= Fichier va indéfiniment charger le meme fichier (qui est le dernier ouvert), meme si la variable Fichier s'incrémente bien.

J'ai alléger mon fichier Excel pour pouvoir le joindre et mais en reva,che je ne peux pas ajouter de fichiers .summary car il n'accepte pas l'extension donc je vais copier coller le code.

Pour le 450000.2017-01-09 08-39-48.summary

<?xml version="1.0"?>
<Reports xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.mtorres.es">
  <Part_data>
    <Part_file>C:\programs\tests\450000.zip</Part_file>
    <Part_number>450000</Part_number>
    <Order_number>2017-01-09 08-39-35</Order_number>
    <Serial_number>2017-01-09 08-39-35</Serial_number>
    <Start>2017/01/09 08:39:50</Start>
    <End>2017/01/09 09:10:00</End>
    <work_center>PI 7648</work_center>
    <machine_type>ATL 3D MULTI TAPE</machine_type>
    <Part_History_version>2.0</Part_History_version>
  </Part_data>
  <Time_report>
    <row Index="-" NC_routine="00:00:00" Ready="00:00:39" Stopped="00:00:08" Unknown="00:00:00" Laying_part="00:00:00" Laying_scrap="00:00:00" Laying_flaw="00:00:00" Panex_cut="00:00:00" Marker="00:00:00" Laser_contour="00:00:00" Compact="00:00:00" Panex_points="00:00:00" Measure="00:00:00" Off_part="00:00:00" Verif_roto="00:00:00" Verif_plate="00:00:00" Fiber="00:00:00" Label="00:00:00" Rototrans="00:00:00" Alarm="00:00:00" Total="00:00:47" />
    <row Index="1" NC_routine="00:00:00" Ready="00:10:21" Stopped="00:07:31" Unknown="00:00:00" Laying_part="00:05:31" Laying_scrap="00:00:00" Laying_flaw="00:00:00" Panex_cut="00:00:00" Marker="00:00:00" Laser_contour="00:00:00" Compact="00:00:00" Panex_points="00:00:00" Measure="00:00:00" Off_part="00:00:00" Verif_roto="00:00:00" Verif_plate="00:00:00" Fiber="00:00:00" Label="00:00:00" Rototrans="00:00:00" Alarm="00:03:53" Total="00:27:16" />
    <row Index="2" NC_routine="00:00:00" Ready="00:01:12" Stopped="00:00:47" Unknown="00:00:00" Laying_part="00:00:00" Laying_scrap="00:00:00" Laying_flaw="00:00:00" Panex_cut="00:00:00" Marker="00:00:00" Laser_contour="00:00:02" Compact="00:00:00" Panex_points="00:00:00" Measure="00:00:00" Off_part="00:00:00" Verif_roto="00:00:00" Verif_plate="00:00:00" Fiber="00:00:00" Label="00:00:00" Rototrans="00:00:00" Alarm="00:00:00" Total="00:02:01" />
    <row Index="Total" NC_routine="00:00:00" Ready="00:12:12" Stopped="00:08:26" Unknown="00:00:00" Laying_part="00:05:31" Laying_scrap="00:00:00" Laying_flaw="00:00:00" Panex_cut="00:00:00" Marker="00:00:00" Laser_contour="00:00:02" Compact="00:00:00" Panex_points="00:00:00" Measure="00:00:00" Off_part="00:00:00" Verif_roto="00:00:00" Verif_plate="00:00:00" Fiber="00:00:00" Label="00:00:00" Rototrans="00:00:00" Alarm="00:03:53" Total="00:30:04" />
  </Time_report>
  <Expense_material_report>
    <row index="-" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="0" Needed="0" />
    <row index="1" Roll_1="8.037207" Roll_2="0" Roll_3="0" Roll_4="0" Total="8.037207" Designed="7.28" Needed="0" />
    <row index="2" Roll_1="8.00000000005241E-05" Roll_2="0" Roll_3="0" Roll_4="0" Total="8.00000000005241E-05" Designed="6.51" Needed="0" />
    <row index="3" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="6.716" Needed="0" />
    <row index="4" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="6.872" Needed="0" />
    <row index="5" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="7.44" Needed="0" />
    <row index="6" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="7.28" Needed="0" />
    <row index="7" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="7.28" Needed="0" />
    <row index="8" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="7.44" Needed="0" />
    <row index="9" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="6.872" Needed="0" />
    <row index="10" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="6.716" Needed="0" />
    <row index="11" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="7.44" Needed="0" />
    <row index="12" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" Designed="7.28" Needed="0" />
    <row index="Total" Roll_1="8.037287" Roll_2="0" Roll_3="0" Roll_4="0" Total="8.037287" Designed="85.126" Needed="0" />
  </Expense_material_report>
  <Expense_flaw_report>
    <row index="-" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="1" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="2" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="3" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="4" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="5" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="6" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="7" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="8" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="9" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="10" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="11" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="12" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="Total" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
  </Expense_flaw_report>
  <Rolls>
    <row roll_number="P0007/A15C" lot_number="40M0009147A" card_number="40M0009147A037" length="60500" width="15000" Sequence="-" Ply="-" Course="-" />
  </Rolls>
  <Alarms>
    <row date_time="2017/01/09 08:39:50" id="End alarm" />
    <row date_time="2017/01/09 08:48:14" id="Start alarm" description=" EMERGENCY STOP;" />
    <row date_time="2017/01/09 08:48:34" id="End alarm" />
    <row date_time="2017/01/09 08:48:38" id="Start alarm" description=" EMERGENCY STOP;" />
    <row date_time="2017/01/09 08:49:37" id="End alarm" />
    <row date_time="2017/01/09 09:04:24" id="Start alarm" description="POWER MUST BE OFF" />
    <row date_time="2017/01/09 09:06:00" id="Start alarm" description="POWER MUST BE OFF" />
    <row date_time="2017/01/09 09:06:58" id="End alarm" />
    <row date_time="2017/01/09 09:09:46" id="End alarm" />
    <row date_time="2017/01/09 09:09:52" id="End alarm" />
  </Alarms>
  <Big_stops_report />
  <Manual_events />
  <Override>
    <row date_time="2017/01/09 09:09:35" index="1" value="0" />
  </Override>
  <Override_tiempos>
    <row Seq="-" Override="0" Time="00:00:00" Start="2017/01/09 08:39:50" />
    <row Seq="Total" Override="14.5187845303868" Time="00:30:10" Start="0001/01/01 00:00:00" />
  </Override_tiempos>
  <Heater>
    <row date_time="2017/01/09 08:39:50" index="-" value="OFF" />
  </Heater>
  <Summary_time_report>
    <row>
      <Index>Total</Index>
      <Ready>00:12:12</Ready>
      <Stopped>00:08:26</Stopped>
      <Alarm>00:03:53</Alarm>
      <Running>00:05:33</Running>
      <Total>00:30:04</Total>
    </row>
  </Summary_time_report>
  <Summary_material_report>
    <row>
      <index>Total</index>
      <Total>1.20559305</Total>
      <Designed>12.7689</Designed>
      <Needed>0</Needed>
    </row>
  </Summary_material_report>
  <Productivity_report>
    <row Seq="-" Orientation="" Orverride="0" Material_needed="0" Time="00:00:47" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="1" Orientation="0" Orverride="15.9920828258222" Material_needed="0" Time="00:27:16" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="2" Orientation="90" Orverride="0.165289256198347" Material_needed="0" Time="00:02:01" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="3" Orientation="45" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="4" Orientation="-45" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="5" Orientation="90" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="6" Orientation="0" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="7" Orientation="0" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="8" Orientation="90" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="9" Orientation="-45" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="10" Orientation="45" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="11" Orientation="90" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="12" Orientation="0" Orverride="0" Material_needed="0" Time="00:00:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="Total" Orientation="" Orverride="14.5187845303868" Material_needed="0" Time="00:30:04" Layup_productivity="0" Ontool_productivity="0" />
  </Productivity_report>
</Reports>

Pour le 450000.2017-01-09 09-10-00.summary

<?xml version="1.0"?>
<Reports xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.mtorres.es">
  <Part_data>
    <Part_file>C:\programs\tests\450000.zip</Part_file>
    <Part_number>450000</Part_number>
    <Order_number>2017-01-09 09-09-52</Order_number>
    <Serial_number>2017-01-09 09-09-52</Serial_number>
    <Start>2017/01/09 09:10:01</Start>
    <End>2017/01/09 11:52:45</End>
    <work_center>PI 7648</work_center>
    <machine_type>ATL 3D MULTI TAPE</machine_type>
    <Part_History_version>2.0</Part_History_version>
  </Part_data>
  <Time_report>
    <row Index="-" NC_routine="00:00:00" Ready="00:01:14" Stopped="00:00:20" Unknown="00:00:00" Laying_part="00:01:14" Laying_scrap="00:00:00" Laying_flaw="00:00:00" Panex_cut="00:00:00" Marker="00:00:00" Laser_contour="00:00:00" Compact="00:00:00" Panex_points="00:00:00" Measure="00:00:00" Off_part="00:00:00" Verif_roto="00:00:00" Verif_plate="00:00:00" Fiber="00:00:00" Label="00:00:00" Rototrans="00:00:00" Alarm="00:00:00" Total="00:02:48" />
    Compact="00:02:00" Panex_points="00:00:00" Measure="00:00:00" Off_part="00:00:00" Verif_roto="00:00:00" Verif_plate="00:00:00" Fiber="00:00:00" Label="00:00:00" Rototrans="00:00:00" Alarm="00:00:25" Total="02:42:44" />
  </Time_report>
  <Expense_material_report>
    <row index="-" Roll_1="1.428268" Roll_2="0" Roll_3="0" Roll_4="0" Total="1.428268" Designed="0" Needed="0" />
    <row index="1" Roll_1="25.320001" Roll_2="0" Roll_3="0" Roll_4="0" Total="25.320001" Designed="7.28" Needed="0" />
    <row index="2" Roll_1="9.875487" Roll_2="0" Roll_3="0" Roll_4="0" Total="9.875487" Designed="6.51" Needed="0" />
    <row index="3" Roll_1="6.716795" Roll_2="0" Roll_3="0" Roll_4="0" Total="6.716795" Designed="6.716" Needed="0" />
    <row index="4" Roll_1="6.87154999999999" Roll_2="0" Roll_3="0" Roll_4="0" Total="6.87154999999999" Designed="6.872" Needed="0" />
    <row index="5" Roll_1="7.44121" Roll_2="0" Roll_3="0" Roll_4="0" Total="7.44121" Designed="7.44" Needed="0" />
    <row index="6" Roll_1="7.279837" Roll_2="0" Roll_3="0" Roll_4="0" Total="7.279837" Designed="7.28" Needed="0" />
    <row index="7" Roll_1="7.27994700000001" Roll_2="0" Roll_3="0" Roll_4="0" Total="7.27994700000001" Designed="7.28" Needed="0" />
    <row index="8" Roll_1="7.441078" Roll_2="0" Roll_3="0" Roll_4="0" Total="7.441078" Designed="7.44" Needed="0" />
    <row index="9" Roll_1="6.870633" Roll_2="0" Roll_3="0" Roll_4="0" Total="6.870633" Designed="6.872" Needed="0" />
    <row index="10" Roll_1="6.71611799999999" Roll_2="0" Roll_3="0" Roll_4="0" Total="6.71611799999999" Designed="6.716" Needed="0" />
    <row index="11" Roll_1="7.439965" Roll_2="0" Roll_3="0" Roll_4="0" Total="7.439965" Designed="7.44" Needed="0" />
    <row index="12" Roll_1="7.27987900000001" Roll_2="0" Roll_3="0" Roll_4="0" Total="7.27987900000001" Designed="7.28" Needed="0" />
    <row index="Total" Roll_1="107.960768" Roll_2="0" Roll_3="0" Roll_4="0" Total="107.960768" Designed="85.126" Needed="0" />
  </Expense_material_report>
  <Expense_flaw_report>
    <row index="-" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="1" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="2" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="3" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="4" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="5" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="6" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="7" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="8" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="9" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="10" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="11" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="12" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
    <row index="Total" Roll_1="0" Roll_2="0" Roll_3="0" Roll_4="0" Total="0" />
  </Expense_flaw_report>
  <Rolls>
    <row roll_number="P0007/A15C" lot_number="40M0009147A" card_number="40M0009147A037" length="60500" width="15000" Sequence="-" Ply="-" Course="-" />
  </Rolls>
  <Alarms>
    <row date_time="2017/01/09 09:10:01" id="End alarm" />
    <row date_time="2017/01/09 09:25:52" id="Start alarm" description="(U1)EXCESS ERROR ( MOVING  )" />
    <row date_time="2017/01/09 09:25:58" id="End alarm" />
    <row date_time="2017/01/09 09:26:25" id="Start alarm" description=" EMERGENCY STOP;" />
    <row date_time="2017/01/09 09:26:44" id="End alarm" />
    <row date_time="2017/01/09 11:52:40" id="End alarm" />
  </Alarms>
  <Big_stops_report />
  <Manual_events />
  <Override>
    <row date_time="2017/01/09 09:10:01" index="-" value="0" />
    <row date_time="2017/01/09 11:51:16" index="12" value="40" />
  </Override>
  <Override_tiempos>
    <row Seq="-" Override="0" Time="00:00:00" Start="2017/01/09 09:10:01" />
    <row Seq="Total" Override="18.5379967226546" Time="02:42:44" Start="0001/01/01 00:00:00" />
  </Override_tiempos>
  <Heater>
    <row date_time="2017/01/09 09:10:01" index="-" value="OFF" />
  </Heater>
  <Summary_time_report>
    <row>
      <Index>Total</Index>
      <Ready>00:25:03</Ready>
      <Stopped>00:56:27</Stopped>
      <Alarm>00:00:25</Alarm>
      <Running>01:20:49</Running>
      <Total>02:42:44</Total>
    </row>
  </Summary_time_report>
  <Summary_material_report>
    <row>
      <index>Total</index>
      <Total>16.1941152</Total>
      <Designed>12.7689</Designed>
      <Needed>0</Needed>
    </row>
  </Summary_material_report>
  <Productivity_report>
    <row Seq="-" Orientation="" Orverride="19.4880952380952" Material_needed="0" Time="00:02:48" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="1" Orientation="0" Orverride="16.0520536803579" Material_needed="0" Time="00:40:59" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="2" Orientation="90" Orverride="7.16555183946489" Material_needed="0" Time="00:29:54" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="3" Orientation="45" Orverride="15.6869806094183" Material_needed="0" Time="00:06:01" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="4" Orientation="-45" Orverride="22.4949152542373" Material_needed="0" Time="00:04:55" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="5" Orientation="90" Orverride="10.6846473029046" Material_needed="0" Time="00:08:02" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="6" Orientation="0" Orverride="20" Material_needed="0" Time="00:04:00" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="7" Orientation="0" Orverride="22.6160337552743" Material_needed="0" Time="00:03:57" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="8" Orientation="90" Orverride="36.6267281105991" Material_needed="0" Time="00:03:37" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="9" Orientation="-45" Orverride="40" Material_needed="0" Time="00:03:55" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="10" Orientation="45" Orverride="40" Material_needed="0" Time="00:03:53" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="11" Orientation="90" Orverride="18.743006993007" Material_needed="0" Time="00:09:32" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="12" Orientation="0" Orverride="24.4459732901659" Material_needed="0" Time="00:41:11" Layup_productivity="0" Ontool_productivity="0" />
    <row Seq="Total" Orientation="" Orverride="18.5379967226546" Material_needed="0" Time="02:42:44" Layup_productivity="0" Ontool_productivity="0" />
  </Productivity_report>
</Reports>

Merci déjà pour avoir rendu mon code un peu plus léger (quel est l'inconvénient des ".Select"?)

A+

Bonjour,

Les "Select" ne font que ralentir le code et il n'y en a pas besoin si on indique bien sur quel objet on travail

Un truc que je ne comprends pas dans le code, c'est le "i = i + 1" à quoi sert-il puisque la variable de la ligne est K

A+

D'accord, j'essaierai de le limiter la prochaine fois, mais vu qu'il y avait beaucoup de feuille dans le fichier c'etait pour être sûr d'appliquer le code sur la bonne feuille.

La variable i sert à savoir le nombre du numéro de programme qu'on a ouvert, effectivement je pense pas qu'elles soient utiles vu qu'elle a été remplacée par q et k mais j'avais du la laisser pour plus de visibilité lors des pas à pas détaillés.

Rechercher des sujets similaires à "soucis actualisation mapping xml vba"