In VBA, we could use for example Wb.VBProject.VBComponents to fetch all the VBA macros of a workbook Wb
.
Does anyone know if JavaScript API for Excel provides any object or function to access that?
No, you cannot get the VBA macros out of the workbook using JS APIs.
Out of curiosity, why would you want to do it? I.e., what would be the pitch you'd make for having us include this API?
~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT