1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Set rs_restite = New ADODB.Recordset
rs_restite.Open 'la requete', db
'Ouverture de l'application
Set appexcel = CreateObject("Excel.Application")
Set mysheet = appexcel.workbooks.Add
appexcel.Visible = True
appexcel.UserControl = True
'Gestion du fichier et ouverture statique
' appexcel.workbooks.Open repertoire
'Visualisation en fond d'ecran la page excel
appexcel.Visible = True
'On remplit l'entete de la page excel
appexcel.Worksheets(1).Cells(1, 1).Value = "NOM"
appexcel.Worksheets(1).Cells(1, 1).Font.Bold = True
appexcel.Worksheets(1).Cells(1, 2).Value = "PRENOM"
appexcel.Worksheets(1).Cells(1, 2).Font.Bold = True
appexcel.Worksheets(1).Cells(1, 4).Value = "PROJET"
appexcel.Worksheets(1).Cells(1, 4).Font.Bold = True
appexcel.Worksheets(1).Cells(1, 5).Value = "TEMPS"
appexcel.Worksheets(1).Cells(1, 5).Font.Bold = True
While Not rs_restite.EOF
' nom
appexcel.Worksheets(1).Cells(i, 1).Value = rs_restite(0)
' prenom
appexcel.Worksheets(1).Cells(i, 2).Value = rs_restite(1)
' projet
appexcel.Worksheets(1).Cells(i, 4).Value = rs_restite(2)
' temps
appexcel.Worksheets(1).Cells(i, 5).Value = rs_restite(3)
i = i + 1
rs_restite.MoveNext
Wend
rs_restite.Close |
Partager