Update add-in file (name.xlam) based on ribbon UI file (CustomUI.xml) under working path. Args: name (str) : the name of add-in to update (without the suffix ``.xlam``). quiet (bool): perform the process in the background if True.
(name:str, quiet:bool=True)
| 43 | |
| 44 | @staticmethod |
| 45 | def update(name:str, quiet:bool=True): |
| 46 | '''Update add-in file (name.xlam) based on ribbon UI file (CustomUI.xml) under working path. |
| 47 | |
| 48 | Args: |
| 49 | name (str) : the name of add-in to update (without the suffix ``.xlam``). |
| 50 | quiet (bool): perform the process in the background if True. |
| 51 | ''' |
| 52 | filename = os.path.join(os.getcwd(), f'{name}.xlam') |
| 53 | addin = Addin(xlam_file=filename, visible=not quiet) |
| 54 | |
| 55 | try: |
| 56 | addin.update() |
| 57 | except Exception as e: |
| 58 | logging.error(e) |
| 59 | addin.close() |
| 60 | else: |
| 61 | if quiet: addin.close() |
| 62 | |
| 63 | |
| 64 | def main(): |