Skip to content

Commit b3bc49a

Browse files
committed
add console error when columns exceed IV
1 parent 10ae7c9 commit b3bc49a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bits/78_writebiff.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@ function write_biff8_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {
382382
}
383383

384384
function write_biff_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {
385+
for(var i = 0; i <= wb.SheetNames.length; ++i) {
386+
var ws = wb.Sheets[wb.SheetNames[i]];
387+
if(!ws || !ws["!ref"]) continue;
388+
var range = decode_range(ws["!ref"]);
389+
if(range.e.c > 255) { // note: 255 is IV
390+
console.error("Worksheet '" + wb.SheetNames[i] + "' extends beyond column IV (255). Data may be lost.");
391+
}
392+
}
393+
385394
var o = opts || {};
386395
switch(o.biff || 2) {
387396
case 8: case 5: return write_biff8_buf(wb, opts);

0 commit comments

Comments
 (0)