Bonjour,
Y a t'il moyen de savoir a quel classeur appartient la macro en cours d'exécution ?
Merci d'avance
Version imprimable
Bonjour,
Y a t'il moyen de savoir a quel classeur appartient la macro en cours d'exécution ?
Merci d'avance
Avec Thisworkbook.name cela devrait fonctionner, non ?
Mais pas forcément, si la macro est lancée à partir d'une barre d'outil !
Merci pour ta réponse en tout cas
D'après le help de ThisWorkbook, il semble que si.
Tu as essayé ?Citation:
ThisWorkbook Property
See AlsoApplies ToExampleSpecificsReturns a Workbook object that represents the workbook where the current macro code is running. Read-only.
Remarks
Use this property to refer to the workbook that contains your macro code. ThisWorkbook is the only way to refer to an add-in workbook from inside the add-in itself. The ActiveWorkbook property doesn't return the add-in workbook; it returns the workbook that's calling the add-in.The Workbooks property may fail, as the workbook name probably changed when you created the add-in. ThisWorkbook always returns the workbook in which the code is running.
For example, use code such as the following to activate a dialog sheet stored in your add-in workbook.
ThisWorkbook.DialogSheets(1).Show
Eh bien effectivement ca marche mille merci !!:king:
Et merci aussi pour les excellents Cours et tutoriels Excel c'est bien pratique :ccool: