Raoul AGONGBE
XLDnaute Nouveau
Bonjour chers tous.
Après avoir fait une ListView, j'ai reçu une alerte d'erreur Erreur d'exécution "13" : Incompatibilité de type. Je n'arrive pas à identifier vraiment la raison.
Je sollicite votre intervention pour résoudre ce problème.
Merci
Function show_data_in_listView()
Dim r As Integer, c As Integer
Dim lastrow As Long
Dim li As Object
ThisWorkbook.Sheets("INSCRIPTION").Activate
lastrow = Sheets("INSCRIPTION").Cells(Rows.Count, 1).End(xlUp).Row
With ListView1
.View = lvwReport
.CheckBoxes = False
.FullRowSelect = True
.Gridlines = True
For c = 1 To 19
With .ColumnHeaders
.Add , , Sheets("INSCRIPTION").Cells(1, c), Sheets("INSCRIPTION").Cells(1, c).Width
End With
Next c
For r = 2 To lastrow
Set li = .ListItems.Add(, , Cells(r, 1))
For c = 2 To 19
li.ListSubItems.Add , , Cells(r, c)
Next c
Next r
End With
End Function
Après avoir fait une ListView, j'ai reçu une alerte d'erreur Erreur d'exécution "13" : Incompatibilité de type. Je n'arrive pas à identifier vraiment la raison.
Je sollicite votre intervention pour résoudre ce problème.
Merci
Function show_data_in_listView()
Dim r As Integer, c As Integer
Dim lastrow As Long
Dim li As Object
ThisWorkbook.Sheets("INSCRIPTION").Activate
lastrow = Sheets("INSCRIPTION").Cells(Rows.Count, 1).End(xlUp).Row
With ListView1
.View = lvwReport
.CheckBoxes = False
.FullRowSelect = True
.Gridlines = True
For c = 1 To 19
With .ColumnHeaders
.Add , , Sheets("INSCRIPTION").Cells(1, c), Sheets("INSCRIPTION").Cells(1, c).Width
End With
Next c
For r = 2 To lastrow
Set li = .ListItems.Add(, , Cells(r, 1))
For c = 2 To 19
li.ListSubItems.Add , , Cells(r, c)
Next c
Next r
End With
End Function