Bonjour,
On vient de me changer le Pc et de me réinstaller Excel 2010 (même version en 32B) et depuis le code ci-dessous ne fonctionne plus, une erreur d'exécution '-2146232576(80131700) Erreur Automation apparaît.
Je pense qu'il faut cocher une option ?? mais je ne me rappelle pas laquelle.
Merci pour votre aide.
Pilougne
'Variables privées de la procédure
Dim société As Range, i As Integer
'// stockage sociétés et intervenants sans doublon dans objet tableau sociétés trié sur société
'création objet tableau sociétés
Set sociétés = CreateObject("system.collections.sortedlist")
'stockage sociétés sans doublon
For Each société In Range("Plage_Societes").Cells 'Plage_Societes = Nom plage de Champs / Boucle sur chaque Objets
If Not sociétés.containskey(société.Value) Then
Set intervenants = CreateObject("system.collections.arraylist") 'création objet tableau intervenants pour la société de la boucle
sociétés.Add société.Value, intervenants ' création élément tableau sociétés avec clé société
End If
'ajout de l'intervenant dans le tableau sociétés
Set intervenants = sociétés(société.Value)
i = société.Row - Range("Plage_Intervenants").Row + 1 'indice de la ligne correspondante dans la plage Intervenants (Plage_Intervenants= Nom plage de Champs)
intervenants.Add Range("Plage_Intervenants").Rows(i).Value
Set sociétés(société.Value) = intervenants
Next société
'// Chargement listbox sociétés
Set sociétés_liste = CreateObject("system.collections.arraylist") '
sociétés_liste.addrange sociétés.keys '
ListBoxSociete.Clear
ListBoxSociete.List = Application.Transpose(Application.Transpose(sociétés_liste.toarray))