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

cannot open workbook by file name. #804

Closed
doraemon1293 opened this issue Jan 30, 2018 · 13 comments
Closed

cannot open workbook by file name. #804

doraemon1293 opened this issue Jan 30, 2018 · 13 comments
Milestone

Comments

@doraemon1293
Copy link

doraemon1293 commented Jan 30, 2018

My code:

import xlwings as xw

app = xw.App()
fn = r"abc.xlsx"
dataWb = app.books.open(fn)

Error

Traceback (most recent call last):
  File "C:\project\learnXlwings\t.py", line 7, in <module>
    dataWb = app.books.open(fn)
  File "C:\Python35\lib\site-packages\xlwings-dev-py3.5.egg\xlwings\main.py", line 2746, in open
    throw = not os.path.samefile(impl.fullname, fullname)
  File "C:\Python35\lib\site-packages\xlwings-dev-py3.5.egg\xlwings\_xlwindows.py", line 488, in fullname
    return self.xl.FullName
AttributeError: 'NoneType' object has no attribute 'FullName'

In _xlwindows.py Class Book

    @property
    def fullname(self):
        return self.xl.FullName

self.xl equals to None

Python 3.5
win7-64
xlwings 0.11.6

@fzumstein
Copy link
Member

Your code is correct. Does Excel open when you do xw.App() and does it have an empty workbook?

@doraemon1293
Copy link
Author

Thank for your reply.

Yes it does.

Today I commented line 2742--2753 in main.py and decrease the indentation of 2754, then everything works fine.

But I don't know whether it has any side effect.

@Razmaniak
Copy link

I have the same issue with latest xlwings package. Unable to connect to existing workbook by name through the book or books command.
app
wb=app.books.open(dest_file)
File "C:\Python36-32\lib\site-packages\xlwings\main.py", line 2746, in open
throw = not os.path.samefile(impl.fullname, fullname)
File "C:\Python36-32\lib\site-packages\xlwings_xlwindows.py", line 488, in fullname
return self.xl.FullName
AttributeError: 'NoneType' object has no attribute 'FullName'
Excel is closed or opened does not makes sense...
Windows 10 - 64 bit
Python 3.6.4 - 32 bit
xlwings 0.11.6

@fzumstein
Copy link
Member

When do downgrade to 0.11.5, does it work properly?

@Razmaniak
Copy link

I've not try it... I've try and response you... Thank you for answer!

@Razmaniak
Copy link

Unfortunately I could not find xlwings version 0.11.5... Could you please give me link for this package?

@Razmaniak
Copy link

I've found 0.11.5 version on following destination https://testpypi.python.org/pypi/xlwings. Now it seems that it works without problems. Thanks fr rapid reply!

@fzumstein
Copy link
Member

can you check if it fails again when you upgrade to 0.11.6 again?

@Razmaniak
Copy link

Unfortunately no success!!!((( The same error after upgrade to version 0.11.6. I've rollback to version 0.11.5. Could I write some questions regarding api directly on your email? Thank you!

@cloud1412a
Copy link

I found the same problem with 0.11.6. Fixed it after rollback to 0.11.5.

@ja14000
Copy link

ja14000 commented Feb 5, 2018

Same issue, rolling back to 0.11.5 fixes it for me too.

@fzumstein
Copy link
Member

I'll look into it today.

@fzumstein fzumstein added this to the v0.11.7 milestone Feb 5, 2018
@fzumstein
Copy link
Member

I've just released 0.11.7 that should fix this issue.

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

No branches or pull requests

5 participants