Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix in Excel interface to avoid closing previously open Excel windows #59

Merged
merged 2 commits into from
Jun 17, 2019

Conversation

blnicho
Copy link
Contributor

@blnicho blnicho commented Jun 17, 2019

Fixes Pyomo/pyomo#355

Summary/Motivation:

Use DispatchEx instead of Dispatch to avoid interfering with open Excel windows. This solution was found based on this StackOverflow question: https://stackoverflow.com/questions/18648933/using-pywin32-what-is-the-difference-between-dispatch-and-dispatchex

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@blnicho blnicho requested a review from jsiirola June 17, 2019 22:02
@jsiirola
Copy link
Contributor

@blnicho: did you test to confirm that this resolves Pyomo/pyomo#355?

@coveralls
Copy link

coveralls commented Jun 17, 2019

Coverage Status

Coverage remained the same at 62.328% when pulling fc6fef5 on excel_fix into fa6ce97 on master.

@blnicho
Copy link
Contributor Author

blnicho commented Jun 17, 2019

I did some limited testing on my Windows machine using Anaconda and Python 3.7.1 and it appears to resolve the issue. I'm not sure how to add a test for this though.

Copy link
Contributor

@jsiirola jsiirola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little disconcerted by the comment in the SO post that "DispatchEx is not documented, so you should just use Dispatch"; however, this seems like a good solution to a fundamental problem.

Would you consider adding a comment pointing to some subset of the pyomo issue / this PR / the SO post as a breadcrumb in case the undocumented API ever disappears?

@blnicho
Copy link
Contributor Author

blnicho commented Jun 17, 2019

Yeah I can do that

@codecov-io
Copy link

Codecov Report

Merging #59 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #59   +/-   ##
=======================================
  Coverage   63.13%   63.13%           
=======================================
  Files          87       87           
  Lines        8702     8702           
=======================================
  Hits         5494     5494           
  Misses       3208     3208
Impacted Files Coverage Δ
pyutilib/excel/spreadsheet_win32com.py 27.56% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa6ce97...fc6fef5. Read the comment docs.

@blnicho blnicho merged commit f40bd59 into master Jun 17, 2019
@jsiirola jsiirola deleted the excel_fix branch June 21, 2019 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pyomo closes any open Excel windows
4 participants