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

Comments

Projects
None yet
5 participants
@doraemon1293

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

This comment has been minimized.

Member

fzumstein commented Jan 30, 2018

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

@doraemon1293

This comment has been minimized.

doraemon1293 commented Jan 31, 2018

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

This comment has been minimized.

Razmaniak commented Feb 2, 2018

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

This comment has been minimized.

Member

fzumstein commented Feb 2, 2018

When do downgrade to 0.11.5, does it work properly?

@Razmaniak

This comment has been minimized.

Razmaniak commented Feb 2, 2018

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

@Razmaniak

This comment has been minimized.

Razmaniak commented Feb 2, 2018

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

@Razmaniak

This comment has been minimized.

Razmaniak commented Feb 2, 2018

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

This comment has been minimized.

Member

fzumstein commented Feb 2, 2018

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

@Razmaniak

This comment has been minimized.

Razmaniak commented Feb 2, 2018

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

This comment has been minimized.

cloud1412a commented Feb 5, 2018

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

@ja14000

This comment has been minimized.

ja14000 commented Feb 5, 2018

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

@fzumstein

This comment has been minimized.

Member

fzumstein commented Feb 5, 2018

I'll look into it today.

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

@fzumstein fzumstein closed this in e433080 Feb 5, 2018

@fzumstein

This comment has been minimized.

Member

fzumstein commented Feb 5, 2018

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