forked from sheetjs/sheetjs
SheetJS
825830d1cd
- DBF writer (dBASE II + VFP extensions) - updated CFB to 0.13.2 - BIFF8 XLS write VBA
19 lines
676 B
JavaScript
19 lines
676 B
JavaScript
function make_vba_xls(cfb/*:CFBContainer*/) {
|
|
var newcfb = CFB.utils.cfb_new({root:"R"});
|
|
cfb.FullPaths.forEach(function(p, i) {
|
|
if(p.slice(-1) === "/" || !p.match(/_VBA_PROJECT_CUR/)) return;
|
|
var newpath = p.replace(/^[^/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/, "");
|
|
CFB.utils.cfb_add(newcfb, newpath, cfb.FileIndex[i].content);
|
|
});
|
|
return CFB.write(newcfb);
|
|
}
|
|
|
|
function fill_vba_xls(cfb/*:CFBContainer*/, vba/*:CFBContainer*/)/*:void*/ {
|
|
vba.FullPaths.forEach(function(p, i) {
|
|
if(i == 0) return;
|
|
var newpath = p.replace(/[^/]*[/]/, "/_VBA_PROJECT_CUR/");
|
|
if(newpath.slice(-1) !== "/") CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content);
|
|
});
|
|
}
|
|
|