Vba access error 440 method run of object '_application' failed
Fermé
dianedg
Messages postés
22
Date d'inscription
mercredi 5 mars 2014
Statut
Membre
Dernière intervention
19 juillet 2016
-
15 juin 2016 à 14:34
f894009 Messages postés 16904 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 18 mars 2023 - 15 juin 2016 à 19:02
f894009 Messages postés 16904 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 18 mars 2023 - 15 juin 2016 à 19:02
1 réponse
f894009
Messages postés
16904
Date d'inscription
dimanche 25 novembre 2007
Statut
Membre
Dernière intervention
18 mars 2023
1 678
15 juin 2016 à 14:57
15 juin 2016 à 14:57
Bonjour,
xl.Application.Run ("'" & wbk.Name & "'!test")
15 juin 2016 à 16:57
Si ça peut aider, voici la macro dans le fichier excel:
Merci d'avance.
Diane
15 juin 2016 à 18:47
Chez moi le code que j'ai mis marche, je l'ai teste avec un fichier a moi et aucun probleme. Je vais voir avec votre code "complet"
15 juin 2016 à 19:02
J'ai pirs un bouton pour lancer, mais un appel de votre procedure marche pareil
Chemin a adapter mais ca marche, jusqu'a une erreur pour le format PDF, mais c'est normal, je n'ai pas le bon fichier xlsx et xlsm
Private Sub Commande16_Click() 'Execute macro for compatibility analysis Dim xl As Excel.Application Dim wbk As Excel.Workbook 'Démarrer Excel et le rendre visible Set xl = New Excel.Application xl.Visible = True 'Ouvrir le classeur qui contient les macros Set wbk = xl.Workbooks.Open("C:\Users\SWF\Downloads\Template_BatchToVialThawing_Compatibility.xlsm") 'Exécuter une macro Excel xl.Application.Run ("'" & wbk.Name & "'!CheckCompatibility") 'Fermer le classeur sans l'enregistrer wbk.Close False Set wbk = Nothing 'Quitter Excel xl.Quit Set xl = Nothing End Sub