Excel addins - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Excel addins (/thread-6325.html) |
Excel addins - rogstad - Nov-16-2017 Dear all, I have a question i am hoping you are able to help me with. I am running the code (snip) below in Jupyter. When it is completed, all addins in Excel are either disabled or have stopped working. I have to disable them in the addin list and enable them again. Are there any way around this? to not disrupt the addins I use. BEst, Rogstad import numpy as np import pandas as pd %matplotlib inline import os import errno import shutil from datetime import datetime pwd = %pwd path = pwd + '/input' try: os.makedirs(path) except OSError: if not os.path.isdir(path): raise path = pwd + '/output' try: os.makedirs(path) except OSError: if not os.path.isdir(path): raise import win32com.client import time import shutil SourcePathName='Path' FileName='Name' Application = win32com.client.Dispatch("Excel.Application") Application.Visible = 1 Workbook = Application.Workbooks.open(SourcePathName + '/' + FileName) Workbook.Save() Application.Quit() |