Skip to content

reuse empty Excel instances in open_excel #1008

Open
@gdementen

Description

@gdementen

Whenever one kills (not stops) a model which opened an Excel file (even if the file is closed when the model is killed), this leaves an empty Excel instance around (because the atexit "kill_global_app" is never called).

This problem is made a lot worse when using run_editor_on_exception() because of our too broad except hook (see larray-project/larray-editor#231) which means we effectively kill programs a lot more often.

I see two options to avoid the proliferation of such empty Excel instances (besides fixing larray-project/larray-editor#231). Either we kill all empty Excel instances before we create a new one, or we reuse an existing one.

I think reusing is slightly better because it is better for performance (avoids opening an Excel instance) and should be enough to avoid proliferation given than we only ever leave behind one extra empty Excel instance at a time. That leaves us with three questions:

  • do we implement an argument to control this or do we do this unconditionally?
  • if not unconditionally, how do we name the argument? reuse_empty_app? do we enable this by default or not?

I can imagine edge cases where this behavior would interact badly with another program trying to pilot Excel at the same time, but this would be so rare that enabling this option by default seems the better choice but I think I would rather do it unconditionally and wait until somebody has a an actual problem with it to implement the argument to disable it.

@alixdamman Do you agree with my analysis?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions