Bonjour à tous et merci d'avance
J'ai une macro Access appelant une macro Excel entre autre.
La feuille table.xls est attachée.
1-La macro exécute ce code sans problème
2-les données sont traitées puis Access les copie dans une feuille resultat.xls
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Function Excel_macro1() Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Open("C:\table.xls") xlApp.Application.Run "''table.xls'!macro1" xlBook.Save xlBook.Close xlApp.Quit Set xlBook = Nothing Set xlApp = Nothing End Function
3-Je veux refaire tourner une macro Excel de la même table avec le code suivant
Access écrit qu'il ne trouve pas le fichier Excel pourtant trouvé avant
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Function Excel_macro2() Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Open("C:\table.xls") xlApp.Application.Run "''table.xls'!macro2" xlBook.Save xlBook.Close xlApp.Quit Set xlBook = Nothing Set xlApp = Nothing End Function
Partager