colibrialuile3
Messages postés26Date d'inscriptionmercredi 4 mai 2005StatutMembreDernière intervention11 mai 2005
-
6 mai 2005 à 08:57
colibrialuile3
Messages postés26Date d'inscriptionmercredi 4 mai 2005StatutMembreDernière intervention11 mai 2005
-
9 mai 2005 à 09:35
Bonjour,
comme le dit mon sujet, Je voudais lancer une macro excel depuis access.
mai je ny arrive pas merci,
colibrialuile3
Messages postés26Date d'inscriptionmercredi 4 mai 2005StatutMembreDernière intervention11 mai 2005 9 mai 2005 à 09:35
Vous etes trop des quiches, moi j'ai trouvé la reponse et ca marche, il suffit de créer un module "SOUS ACCESS", et bien sur de faire (quand le module est ouvert) ; OUTILS => REFERENCE =>Microsoft excel 9.0 Object library (et le cocher).
voila le module qu'il faut ecrire:
Public Function lancermacroexcel()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("C:\Classeur1.xls") 'Chemin d'accés du fichier.xls
xlApp.Run "Macro1" 'Nom de la macro
xlBook.Close
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing