At the institute, in production practice they were given the task - to write a kind of installer with options for importing and exporting macros to Excel. Made the implementation through the import of macros in the Personal Macro book:
var App = new Excel.Application { Visible = false }; var PersonalWorkBook = App.Workbooks.Open($"{System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData)}\\Microsoft\\Excel\\XLSTART\\PERSONAL.XLSB"); PersonalWorkBook.VBProject.VBComponents.Import(FileName); PersonalWorkBook.Save(); App.Quit(); But this option was not passed in the company, because of the security policies, appeals to the Personal Book are suppressed. Now I am at an impasse, I do not know how else this can be realized. In general, the program can be described as follows:
- Macros are added to the program, a description of them is entered, a certain macro library is obtained.
- An employee of the IT department comes with this program to the user, selects the macros he needs and imports them to him in a couple of clicks.
Example of the program:

Но этот вариант не прошел на фирме, из-за политик безопасности обращения к Персональной книге пресекаются.Did you check it with IT rights? - sp7