I want to update all the functions on my current workbook when I am working on it by the press of a button from the ribbon but the refreshAll function does not work. Following is the refresh_func function mapped to button clicked which run the logic
from win32com.client.gencache import EnsureDispatch
def refresh_func():
ExcelApp = EnsureDispatch('Excel.Application')
ExcelApp.Visible = True
ExcelWrkbook = ExcelApp.Workbooks(1)
ExcelWrkbook.RefreshAll()
Specs:
Python 3.8.6 32 bit
Pyxll 5.0.5 32 bit
Microsoft Excel 2016
There can be a situation that the excel file is not saved and the user would like to update the function on his working sheet but does not want to save it. Also, the solution should not force me to save or close a file for the solution to work or refresh the function
I am open to any github package that solves this issue.