forked from sheetjs/sheetjs
Fixed vbaraw
parsing
- fixes #594 h/t @fossamagna - fixes #348 h/t @aleramesh
This commit is contained in:
parent
88eb98587c
commit
05185e13f2
@ -135,7 +135,7 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
|
||||
out.files = zip.files;
|
||||
}
|
||||
if(opts.bookVBA) {
|
||||
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0],true);
|
||||
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0].replace(/^\//,''),true);
|
||||
else if(dir.defaults && dir.defaults.bin === 'application/vnd.ms-office.vbaProject') out.vbaraw = getzipdata(zip,'xl/vbaProject.bin',true);
|
||||
}
|
||||
return out;
|
||||
|
4
test.js
4
test.js
@ -434,9 +434,9 @@ describe('parse options', function() {
|
||||
});
|
||||
it('bookVBA should generate vbaraw (XLSX/XLSB)', function() {
|
||||
var wb = X.readFile(paths.nfxlsx,{bookVBA:true});
|
||||
assert(typeof wb.vbaraw !== 'undefined');
|
||||
assert(wb.vbaraw);
|
||||
wb = X.readFile(paths.nfxlsb,{bookVBA:true});
|
||||
assert(typeof wb.vbaraw !== 'undefined');
|
||||
assert(wb.vbaraw);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -13280,7 +13280,7 @@ function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
|
||||
out.files = zip.files;
|
||||
}
|
||||
if(opts.bookVBA) {
|
||||
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0],true);
|
||||
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0].replace(/^\//,''),true);
|
||||
else if(dir.defaults && dir.defaults.bin === 'application/vnd.ms-office.vbaProject') out.vbaraw = getzipdata(zip,'xl/vbaProject.bin',true);
|
||||
}
|
||||
return out;
|
||||
|
2
xlsx.js
2
xlsx.js
@ -13223,7 +13223,7 @@ function parse_zip(zip, opts) {
|
||||
out.files = zip.files;
|
||||
}
|
||||
if(opts.bookVBA) {
|
||||
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0],true);
|
||||
if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0].replace(/^\//,''),true);
|
||||
else if(dir.defaults && dir.defaults.bin === 'application/vnd.ms-office.vbaProject') out.vbaraw = getzipdata(zip,'xl/vbaProject.bin',true);
|
||||
}
|
||||
return out;
|
||||
|
Loading…
Reference in New Issue
Block a user