- Dim i As Integer
- Private Sub ExportExcel_Click()
- 'Chemin du fichier a modifier à chaque installation
- repertoire = "C:\fichier.xls"
- 'Ouverture de l'application
- Set appexcel = New Excel.Application
- '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, 2).Value = "feuille 1 cellule A2"
- appexcel.Worksheets(2).Cells(1, 2).Value = "feuille 2 cellule A2"
- For i = 1 To 2
- appexcel.Worksheets(1).Cells(1, i).Font.Bold = True
- appexcel.Worksheets(1).Cells(1, i).Font.Size = 8
- appexcel.Worksheets(1).Cells(1, i).HorizontalAlignment = xlCenter
- appexcel.Worksheets(1).Cells(1, i).VerticalAlignment = xlCenter
- Next i
- End Sub
-
Dim i As Integer
Private Sub ExportExcel_Click()
'Chemin du fichier a modifier à chaque installation
repertoire = "C:\fichier.xls"
'Ouverture de l'application
Set appexcel = New Excel.Application
'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, 2).Value = "feuille 1 cellule A2"
appexcel.Worksheets(2).Cells(1, 2).Value = "feuille 2 cellule A2"
For i = 1 To 2
appexcel.Worksheets(1).Cells(1, i).Font.Bold = True
appexcel.Worksheets(1).Cells(1, i).Font.Size = 8
appexcel.Worksheets(1).Cells(1, i).HorizontalAlignment = xlCenter
appexcel.Worksheets(1).Cells(1, i).VerticalAlignment = xlCenter
Next i
End Sub