It is often useful to freeze excel while running some code, freeze in the sense of disabling (=setting to False):
- Application.ScreenUpdating
- Application.EnableEvents
- Application.DisplayAlerts
- setting calculation mode to manual
A nice API would be a simple context_manager in the vein of:
with app.freeze(events=True, screen=True, alerts=True, calculation=True):
... do some expensive changes in a workbook ...
that would save the status of these variables, change them according to the flags, yield and then set back the variables back to their original status.
Any feedback on the API ? if ok, i'll do a PR for the Windows version (I have no experience nor access to a Mac)
It is often useful to freeze excel while running some code, freeze in the sense of disabling (=setting to False):
A nice API would be a simple context_manager in the vein of:
that would save the status of these variables, change them according to the flags, yield and then set back the variables back to their original status.
Any feedback on the API ? if ok, i'll do a PR for the Windows version (I have no experience nor access to a Mac)