Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
mac: cannot handle sheet names with spaces inside #889
More precisely, given two sheets:
<Name 'rc_past': =through_time!$E$5:$F$11>
The followin diff seems to "fix" it:
@@ -1033,6 +1035,9 @@ class Name(object): @property def refers_to_range(self): ref = self.refers_to[1:].split('!') + sheetname = ref + if sheetname.startswith("'") and sheetname.endswith("'"): + ref = sheetname[1:-1] book = self.parent if isinstance(self.parent, Book) else self.parent.book return Range(Sheet(book, ref), ref)
Can you please include a self contained example? I can't replicated with the following code:
maybe you're mixing workbook and sheet scope?
Within this book we have a sheet named "ba bar" and a named cell within.
While iterating on the names, we get to the issue:
b = xlwings.Book('book.xlsx') for n in b.names: print(n.refers_to_range)
Traceback (most recent call last):
The above exception was the direct cause of the following exception: