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
| Private Sub Commande50_Click()
Lien = OuvrirUnFichier(Application.hWndAccessApp, "Parcourir", 1, "Fichier excel", "xls")'macro qui provient de la FAQ de developpez.com
DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, _
"Justif_solde", _
Lien, _
True
'J'initialise mes variables
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(Lien)
'Ajouter une feuille de calcul nommée Toto
Set xlSheet = xlBook.Worksheets.Add
xlSheet.Name = "Copy"
'Manipuler une cellule
xlSheet.Cells(1, 1) = "Réalisé par "
xlBook.Save
xlApp.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
End Sub |