Get all the VBA macros of a workbook by JavaScript API for Excel

571 Views Asked by At

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?

2

There are 2 best solutions below

6
On BEST ANSWER

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

1
On

I think this github project is what you're looking for:

https://github.com/vbaidiot/Ariawase/blob/master/vbac.wsf