j'ai fait un prog de gestion de pieces machine et jexport mes recordset sous excel jusque'a la ca fonctionne mais quand je veut fait des calcul sous excel exemple somme d'une colonne la reponse est ZERO "0" comme si ma colonne etait vide pourquoi ????????? comment remedier ???
voici comment je fait:
ASEM67
Private Sub CmdeExcel_Click()
Dim a As New Excel.Application
Dim ligne As Long
ligne = 3
a.Visible = True
a.Workbooks.Add
With a.ActiveWorkbook.Worksheets("Feuil1")
a.Columns("a").ColumnWidth = 4
a.Columns("b").ColumnWidth = 9
a.Columns("c").ColumnWidth = 9
a.Columns("d").ColumnWidth = 17
a.Columns("e").ColumnWidth = 20
a.Columns("f").ColumnWidth = 29
a.Columns("g").ColumnWidth = 3
a.Columns("h").ColumnWidth = 3
a.Columns("i").ColumnWidth = 3
a.Columns("j").ColumnWidth = 3
a.Columns("k").ColumnWidth = 6
a.Columns("l").ColumnWidth = 25
a.Columns("m").ColumnWidth = 13
Data.rsTCmde.MoveFirst
a.Cells.Font.Name = "arial"
a.Cells.Font.Size = 10
a.Cells(1, "a") = "NC"
a.Cells(1, "b") = "Date Cmde"
a.Cells(1, "c") = "Date Recep"
a.Cells(1, "d") = "Réf.Interne"
a.Cells(1, "e") = "Réf.Fournisseur"
a.Cells(1, "f") = "Désignation"
a.Cells(1, "g") = "QtC"
a.Cells(1, "h") = "QtR"
a.Cells(1, "i") = "U"
a.Cells(1, "j") = "Delai"
a.Cells(1, "k") = "Prix"
a.Cells(1, "l") = "Machine"
a.Cells(1, "m") = "Fournisseur"
Do Until Data.rsTCmde.EOF
a.Cells(ligne, 1) = Data.rsTCmde!NumeroCmde
a.Cells(ligne, 2) = Data.rsTCmde!DateCmde
a.Cells(ligne, 3) = Data.rsTCmde!CmdeReçusLe
a.Cells(ligne, 4) = Data.rsTCmde!RéfInterne
a.Cells(ligne, 5) = Data.rsTCmde!RéfFournisseur
a.Cells(ligne, 6) = Data.rsTCmde!Désignation
a.Cells(ligne, 7) = Data.rsTCmde!Qcmde
a.Cells(ligne, 8) = Data.rsTCmde!Qreçus
a.Cells(ligne, 9) = Data.rsTCmde!Unité
a.Cells(ligne, 10) = Data.rsTCmde!Délai
a.Cells(ligne, 11) = Data.rsTCmde!la
a.Cells(ligne, 12) = Data.rsTCmde!machine
a.Cells(ligne, 13) = Data.rsTCmde!fournisseur
ligne = ligne + Text1.Text
Data.rsTCmde.MoveNext
Loop
End With
End Sub