:exclam: je m'excuse mais il ya personne qui m'a répondu alors j'ai refait le sujet pour redemander l'aide ! voilà je ne sais pas pourquoi mon programme ce plante :casstet: qand il arrive à ça : " Dim Entite As AcadBlockReference" stp voilà le programme le but est de selectionner tout les attributs qui ce trouve dans le dessin courant et les mettre dans la variable "temp" pour les réutilisés après merci infinnement pour votre aide si précieuse ! ' --------------------------------------------------- 'Section 4. Sélection du dessin en cours ' --------------------------------------------------- Dim EnTete As Boolean Rangee = 1 EnTete = False If selection_existe("TEMP") Then Set Selection = ThisDrawing.SelectionSets("TEMP") Selection.Clear Else Set Selection = ThisDrawing.SelectionSets.Add("TEMP") End If Selection.Select acSelectionSetAll, Codes, Valeurs ' --------------------------------------------------- 'Section 4. Extraction des attributs. ' --------------------------------------------------- Dim Entite As AcadBlockReference For Each Entite In Selection Matrice = Entite.GetAttributes If EnTete = False Then For Compte = LBound(Matrice) To UBound(Matrice) If StrComp(Matrice(Compte).EntityName, "AcDbAttribute", 1) = 0 Then Feuille.Cells(Rangee, Compte + 1).Value = Matrice(Compte).TagString End If Next Compte End If Rangee = Rangee + 1 For Compte = LBound(Matrice) To UBound(Matrice) Feuille.Cells(Rangee, Compte + 1).Value = Matrice(Compte).TextString Next Compte EnTete = True Next ' --------------------------------------------------- 'Section 6. effacer la selection "TEMP" ' --------------------------------------------------- Public Function selection_existe(strnom As String) As Boolean Dim control As Boolean control = False On Error Resume Next Set objselection = ThisDrawing.SelectionSets(strnom) If Err Then Err.Clear Set objselection = ThisDrawing.SelectionSets.Add(strnom) If Not Err Then control = True Else control = True End If selection_existe = control End Function