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
| Private Sub MAJ()
Dim nameFile As String, periode As String
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
nameFile = loadXLS
If StrComp(nameFile, "") = 0 Then
Exit Sub
End If
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(nameFile)
periode = xlBook.Worksheets("Matrix sheet").Cells(1, 1).value
xlBook.Worksheets("Matrix sheet").Cells(1, 1).value = "BSC"
xlBook.Save
xlBook.Close
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "GPRS_BSC_Temp", nameFile, True, "A1:I100"
Set xlBook = xlApp.Workbooks.Open(nameFile)
xlBook.Worksheets("Matrix sheet").Cells(1, 1).value = periode
xlBook.Save
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
End Sub |
Partager