Skip to content

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

Closed

Description

@fzumstein
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)

Activity

  1. added this to the milestone on Jan 14, 2017
  2. Ashish424 commented on Jan 7, 2018

    @Ashish424

    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.

  3. fzumstein commented on Jan 7, 2018

    @fzumstein
    MemberAuthor

    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.

  4. Ashish424 commented on Jan 7, 2018

    @Ashish424

    Ok,thanks.

  5. modified the milestones: , v0.11.6 on Jan 22, 2018
  6. added a commit that references this issue on Jan 23, 2018
    fd430f2
  7. changed the title [-]COM Retry wrapper fails when clicking around in Excel[/-] [+][Win] COM Retry wrapper fails when clicking around in Excel[/+] on Jan 23, 2018
  8. fzumstein commented on Jan 23, 2018

    @fzumstein
    MemberAuthor

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

  9. Ashish424 commented on Aug 3, 2018

    @Ashish424

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

  10. ElisabethDuijnstee commented on Jun 30, 2021

    @ElisabethDuijnstee

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions