1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Private Sub Command1_Click()
Dim xlapp As New Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Set xlbook = xlapp.Workbooks.Add
Set xlsheet = xlbook.Worksheets(1)
xlsheet.Cells(1, 2) = 5000
xlsheet.Cells(2, 2) = 75
xlsheet.Cells(3, 1) = "Total"
xlsheet.Range("B3").Formula = "=Sum(R1C2:R2C2)"
xlsheet.Range("B3").Font.Bold = True
xlsheet.Application.Visible = True
'xlsheet.SaveAs ("C:\feuille_1.xls"), True
'xlbook.Close
'xlapp.Quit
'Set xlsheet = Nothing
'Set xlbook = Nothing
'Set xlbook = Nothing
End Sub |