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
|
Dim xlApp As EXCEL.Application
Dim xlBook As EXCEL.Workbook
Dim xlSheet As EXCEL.Worksheet
Dim sSql As String
Dim rst As New ADODB.Recordset
Dim oApp As EXCEL.Application
Set oApp = New EXCEL.Application
Dim oS As EXCEL.Worksheet
sSql = "R_production"
...
rst.Open sSql, CurrentProject.Connection, adOpenStatic
...
With oApp.Workbooks(1)
.Worksheets("Feuil1").Range("A8", "I35").ClearContents
.Save
.Close
End With
...
With xlSheet
.Cells(8, 1).CopyFromRecordset rst "
End With
...
rst.Close
...
Set rst = Nothing
...
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing |
Partager