1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Dim appexcel As Excel.Application
Dim wbexcel As Excel.Workbook
Dim strFile As String
'Adresse du fichier à créer
strFile = CurrentProject.Path & "\trululucocotte.xls"
'Export de la requête dans un nouveau fichier xls
DoCmd.OutputTo acOutputQuery, "rqt_Lst_Alertes_FIFO", "xls", strFile
'Prise en main du fichier excel
Set appexcel = CreateObject("Excel.Application")
appexcel.Visible = True
Set wbexcel = appexcel.Workbooks.Open(strFile)
appexcel.Sheets("rqt_Lst_Alertes_FIFO").Select
appexcel.Sheets("rqt_Lst_Alertes_FIFO").Name = "Lst_Alertes_FIFO"
'Mise en forme avec des tas de truc et de couleurs
appexcel.Sheets("Lst_Alertes_FIFO").Rows(1).Insert
appexcel.Sheets("Lst_Alertes_FIFO").Range("A1").Value = "...."
'enregistrement du travail final
wbexcel.Save
wbexcel.close |
Partager