XFExt 0x000B throws exception
See original GitHub issueI received a file XLS that I parsed using
XLS.readFile(importFile) ;
it failed with error “bafuqb”
After some debugging, I found that it is due to the presence of a XFExt with value 0x000B which is not known by the function :
/* xf is an XF, see parse_XFExt for xfext */
function update_xfext(xf, xfext) {
xfext.forEach(function(xfe) {
switch(xfe[0]) { /* 2.5.108 extPropData */
case 0x04: break; /* foreground color */
case 0x05: break; /* background color */
case 0x07: case 0x08: case 0x09: case 0x0a: break;
case 0x0d: break; /* text color */
case 0x0e: break; /* font scheme */
default: throw "bafuq" + xfe[0].toString(16);
}
});
}
Looking at MSDN documentation (https://msdn.microsoft.com/en-us/library/dd906769(v=office.12).aspx), this value is about “the diagonal cell border color”.
adding the following case solved my problem :
case 0x0b: break;
A workaround to read the file, is to manually open it in Excel before a remove all cell formatting
please note that it seems that values 0x06 and 0x0f are also missing in the function
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Throw Exceptions in Java - Rollbar
Throwing an exception is as simple as using the "throw" statement. You then specify the Exception object you wish to throw. Every Exception...
Read more >How to Throw Exceptions (The Java™ Tutorials > Essential ...
Regardless of what throws the exception, it's always thrown with the throw statement. As you have probably noticed, the Java platform provides numerous ......
Read more >Creating and Throwing Exceptions | Microsoft Learn
The runtime then searches for the most compatible exception handler. Programmers should throw exceptions when one or more of the following ...
Read more >throw - JavaScript - MDN Web Docs - Mozilla
The throw statement throws a user-defined exception. Execution of the current function will stop (the statements after throw won't be ...
Read more >Mockito test a void method throws an exception - Stack Overflow
The parentheses are poorly placed. You need to use: doThrow(new Exception()).when(mockedObject).methodReturningVoid(...); ^. and NOT use:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @aimcom @baharudinafif that throw statement should have been guarded with a WTF check. We’re removing the throw in 0.9.2
When trying to import an Excel file (format “XLS”) with js-xlsx 0.8.1, I got the error “bafuqb”, too. I’ve created a small Excel file with only one row and no content to reproduce the problem: https://drive.google.com/open?id=0B09zLCh79hV5NzVVMUR3ZzhUcEE