-
Notifications
You must be signed in to change notification settings - Fork 504
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
.labels #276
Comments
I'd really need to see a copy of your excel file in order to understand why this isn't working properly.Can you create a gist for this issue (sample gist)? Here are some instructions for creating such a gist.
|
@rogsmith Any chance I could see a sample of the file that caused the error you encountered? |
Please reopen if the issue occurs again. |
I just ran into a sheet exhibiting this issue. The |
Here's the simplest fix I can see for this: diff --git a/lib/roo/excelx/workbook.rb b/lib/roo/excelx/workbook.rb
index 7ef841f..bb79e02 100644
--- a/lib/roo/excelx/workbook.rb
+++ b/lib/roo/excelx/workbook.rb
@@ -32,10 +32,12 @@ module Roo
Hash[doc.xpath('//definedName').map do |defined_name|
# "Sheet1!$C$5"
sheet, coordinates = defined_name.text.split('!$', 2)
+ next if coordinates.nil?
+
col, row = coordinates.split('$')
name = defined_name['name']
[name, Label.new(name, sheet, row, col)]
- end]
+ end.compact]
end
def base_date If you want to actually represent invalid labels in the hash returned by |
@stevendaniels Do you want me to open a PR with my suggested change? |
NoMethodError: undefined method
split' for nil:NilClass lib/roo/excelx/workbook.rb:35:in
block in defined_names'The text was updated successfully, but these errors were encountered: