MCPcopy Create free account
hub / github.com/dothinking/PyAddin / __init__

Method __init__

pyaddin/xlam/vba.py:7–21  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5class 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):

Callers

nothing calls this directly

Calls 1

AddInExceptionClass · 0.85

Tested by

no test coverage detected