erreur 70 ...

Defter

XLDnaute Nouveau
c'est assez vaste l'erreur 70 ça commence avec des notion de pile saturée jusqu'a ... bref moi je ne sais mon petit niveau en VBA ne suffit pas.
le but est d'avoir une arborescence apartir de ces fichiers :

donc mise en forme est le premier fichier a utiliser on coche les bonnes options et on vas chercher extraction et là on laisse courir ... et bimm ça coince 'fin chez moi (EXCEL 2000)

du coup a l'aide

Edit :

suppression de la piece joints obsolete
 
Dernière édition:

Defter

XLDnaute Nouveau
Re : erreur 70 ...

bon en fait apres une petite retouche parce que ça coincait un peu avant


les parent sont du type : 1, 1_1, 1_2, 1_2_1,1_2_1_10... (toujours pars ordre croissant)
le niveau c'est le niveau de génération ,de profondeur ... pas de limite
attribut c'est un string contenu dans une case
style 1 ou 0 pour dissocier une mise en forme



Code:
Sub créeShape(parent, niv, Attribut, Style)  ' procédure récursive
'If parent = "1_9" Then colonne = "pb"                  '<---- erreur pour debug
    colonne = colonne + 1
    txt = parent & " : " & Attribut
If Style = "0" Then
  hauteurshape = 25
  largeurshape = 180
'erreur 70 v
  Org.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, largeurshape, hauteurshape).name = parent
'erreur 70 ^
  Org.Shapes(parent).Line.ForeColor.SchemeColor = 22
  With Org.Shapes(parent)
    .TextFrame.Characters.text = txt
    .TextFrame.Characters(Start:=1, Length:=1000).Font.Size = 8
    .TextFrame.Characters(Start:=1, Length:=Len(parent)).Font.Bold = True
    .Fill.ForeColor.RGB = RGB(255, 255, 255)
    .TextFrame.Characters(Start:=1, Length:=Len(parent)).Font.Color = vbRed
    .TextFrame.Characters(Start:=1, Length:=Len(parent)).Font.Size = 6
  End With
Else
  hauteurshape = 45
  largeurshape = 160
  Org.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, largeurshape, hauteurshape).name = parent
  Org.Shapes(parent).Line.ForeColor.SchemeColor = 8
With Org.Shapes(parent)
    .TextFrame.Characters.text = txt
    .TextFrame.Characters(Start:=1, Length:=1000).Font.Size = 8
    .TextFrame.Characters(Start:=1, Length:=Len(parent)).Font.Bold = True
    .Fill.ForeColor.RGB = RGB(255, 255, 255)
    .TextFrame.Characters(Start:=1, Length:=Len(parent)).Font.Color = vbRed
    .TextFrame.Characters(Start:=1, Length:=Len(parent)).Font.Size = 6
  End With
End If
  Org.Shapes(parent).Left = DebutOrg.Left + niv * inth
  Org.Shapes(parent).Top = DebutOrg.Top + intv * colonne
  Set VariableObjet = Nothing
    For i = 2 To n
    val01 = Tbd(i, 2)
    val01 = CStr(val01)
        If IsNumeric(val01) Then
            lenght = Len(val01)
        Else
            lenght = InStr(StrReverse(val01), "_")
            lenght = Len(val01) - lenght
        End If
        If Tbd(i, 2) = parent And niv > 1 Then
         shapePère = Left(val01, lenght)
         Org.Shapes.AddConnector(msoConnectorElbow, 100, 100, 100, 100).name = parent & "c"
         Org.Shapes(parent & "c").Line.ForeColor.SchemeColor = 22
         Org.Shapes(parent & "c").ConnectorFormat.BeginConnect Org.Shapes(shapePère), 3
         Org.Shapes(parent & "c").ConnectorFormat.EndConnect Org.Shapes(parent), 2
     End If
     parent = CStr(parent)
     Debug.Print parent & " et " & Left(val01, lenght)
    If Left(val01, lenght) = parent Then créeShape Tbd(i, 2), niv + 1, Tbd(i, 1), Tbd(i, 3)
  Next i
End Sub
 

Pièces jointes

  • EXTRACTION.XLS
    9.1 KB · Affichages: 19
  • Mise en forme des nomenclatures WM LG.xls
    173 KB · Affichages: 29
  • EXTRACTION.XLS
    9.1 KB · Affichages: 31
  • EXTRACTION.XLS
    9.1 KB · Affichages: 34

Discussions similaires

Statistiques des forums

Discussions
312 775
Messages
2 092 023
Membres
105 152
dernier inscrit
pago