Skip to content

[Win] COM Retry wrapper fails when clicking around in Excel #587

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

Closed
fzumstein opened this issue Nov 20, 2016 · 6 comments · Fixed by #800
Closed

[Win] COM Retry wrapper fails when clicking around in Excel #587

fzumstein opened this issue Nov 20, 2016 · 6 comments · Fixed by #800
Labels
Milestone

Comments

@fzumstein
Copy link
Member

fzumstein commented Nov 20, 2016

import xlwings as xw
import time
import datetime as dt

xw.Range('A1').number_format = 'dd/mm/yy hh:mm:ss'  # include seconds
while True:
    xw.Range('A1').value = dt.datetime.now()
    time.sleep(0.5)

This works when writing into a cell - it resumes correctly. But when double clicking a few cells randomly, it fails with the following error:

                 Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\main.py", line 1498, in value
    conversion.write(data, self, self._options)
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\conversion\__init__.py", line 35, in write
    pipeline(ctx)
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\conversion\framework.py", line 66, in __call__
    stage(*args, **kwargs)
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\conversion\standard.py", line 91, in __call__
    self._write_value(ctx.range, ctx.value, scalar)
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\conversion\standard.py", line 71, in _write_value
    rng.raw_value = value
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\main.py", line 1119, in raw_value
    self.impl.raw_value = data
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\_xlwindows.py", line 710, in raw_value
    self.xl.Value = data
  File "C:\Users\felix\Anaconda\lib\site-packages\xlwings\_xlwindows.py", line 99, in __setattr__
    return setattr(self._inner, key, value)
  File "C:\Users\felix\Anaconda\lib\site-packages\win32com\client\dynamic.py", line 565, in __setattr__
    self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2146777998), None)
@Ashish424
Copy link

Can you tell when this issue is planned to resolve?This is really critical for an application I am working on and will be grateful to see this fixed.

@fzumstein
Copy link
Member Author

It looks like a bug that's hard to track down and at the same time not critical for most users, so no, I can't give you a timeline.

@Ashish424
Copy link

Ok,thanks.

@fzumstein fzumstein modified the milestones: short list, v0.11.6 Jan 22, 2018
fzumstein added a commit that referenced this issue Jan 23, 2018
…apper

fixed COM retry wrapper when clicking in cells closes #587
@fzumstein fzumstein changed the title COM Retry wrapper fails when clicking around in Excel [Win] COM Retry wrapper fails when clicking around in Excel Jan 23, 2018
@fzumstein
Copy link
Member Author

@Ashish424 is now fixed and will be part of upcoming 0.11.6 release

@Ashish424
Copy link

I checked this project after a long time,Thanks a lot :)

@ElisabethDuijnstee
Copy link

hi! i have the same error message but not able to resolve yet. how did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants