Process VBA modules for add-in file, e.g., add callback function based on ribbon menu. Args: xlam_file (str): Add-in filename. excel_app (win32 COM object): The Excel application instance.
(self, xlam_file:str, excel_app)
| 5 | class VBA: |
| 6 | |
| 7 | def __init__(self, xlam_file:str, excel_app): |
| 8 | '''Process VBA modules for add-in file, e.g., add callback function based on ribbon menu. |
| 9 | |
| 10 | Args: |
| 11 | xlam_file (str): Add-in filename. |
| 12 | excel_app (win32 COM object): The Excel application instance. |
| 13 | ''' |
| 14 | self.xlam_file = xlam_file |
| 15 | if not os.path.exists(xlam_file): |
| 16 | raise AddInException(f'Not find add-in file: {self.xlam_file}.') |
| 17 | |
| 18 | # current workbook |
| 19 | self.wb = excel_app.Workbooks.open(xlam_file) |
| 20 | self.wb.DoNotPromptForConvert = True |
| 21 | self.wb.CheckCompatibility = False |
| 22 | |
| 23 | |
| 24 | def save(self): |
nothing calls this directly
no test coverage detected