Add a library reference to VBA project in workbook

How to Add a library reference to VBA project in workbook

The following sample code adds or registers two library references to the VBA project of the workbook using VbaProject.getReferences().addRegisteredReference() method.