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

wb.save() on macOS causes confirmation prompt #957

Closed
fzumstein opened this issue Oct 17, 2018 · 2 comments · Fixed by #1372
Closed

wb.save() on macOS causes confirmation prompt #957

fzumstein opened this issue Oct 17, 2018 · 2 comments · Fixed by #1372

Comments

@fzumstein
Copy link
Member

OS (e.g. Windows 10 or macOS Sierra)

macOS Sierra

Versions of xlwings, Excel and Python (e.g. 0.11.8, Office 365, Python 3.7)

0.12.1, Office 16.19, Python 3.7

Describe your issue (incl. Traceback!)

wb.save() on macOS causes confirmation prompt

Include a minimal code sample to reproduce the issue (and attach a sample workbook if required!)

Run the followin 2x on from within a new Excel instance.

import xlwings as xw
wb = xw.Book()
wb.save()
@fzumstein fzumstein added the bug label Oct 17, 2018
@jeckun
Copy link

jeckun commented Mar 2, 2019

I have the same problem.
The code and error hints are as follows

import xlwings as xw
app = xw.App(visible=True, add_book=False)
wb = app.books.add()
wb.save()
wb.close() 

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aeosa/appscript/reference.py", line 482, in call
return self.AS_appdata.target().event(self._code, params, atts, codecs=self.AS_appdata).send(timeout, sendflags)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aeosa/aem/aemsend.py", line 92, in send
raise EventError(errornum, errormsg, eventresult)
aem.aemsend.EventError: Command failed: The object you are trying to access does not exist (-1728)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xlwings/main.py", line 682, in close
self.impl.close()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xlwings/_xlmac.py", line 224, in close
self.xl.close(saving=kw.no)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aeosa/appscript/reference.py", line 518, in call
raise CommandError(self, (args, kargs), e, self.AS_appdata) from e
appscript.reference.CommandError: Command failed:
OSERROR: -1728
MESSAGE: The object you are trying to access does not exist
COMMAND: app('/Applications/Microsoft Excel.app', newinstance=(0, 5907874)).workbooks['工作簿1'].close(saving=k.no)

@michaelobr
Copy link

I am having the same issue as @jeckun , was anybody able to resolve this?

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

Successfully merging a pull request may close this issue.

3 participants