2018-02-04 23:58:00 +00:00
|
|
|
var CT_VBA = "application/vnd.ms-office.vbaProject";
|
2017-10-02 08:15:36 +00:00
|
|
|
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;
|
2018-02-08 18:21:39 +00:00
|
|
|
var newpath = p.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/, "");
|
2017-10-02 08:15:36 +00:00
|
|
|
CFB.utils.cfb_add(newcfb, newpath, cfb.FileIndex[i].content);
|
|
|
|
});
|
|
|
|
return CFB.write(newcfb);
|
|
|
|
}
|
2017-10-27 16:25:54 +00:00
|
|
|
|
|
|
|
function fill_vba_xls(cfb/*:CFBContainer*/, vba/*:CFBContainer*/)/*:void*/ {
|
|
|
|
vba.FullPaths.forEach(function(p, i) {
|
|
|
|
if(i == 0) return;
|
2018-02-08 18:21:39 +00:00
|
|
|
var newpath = p.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/");
|
2017-10-27 16:25:54 +00:00
|
|
|
if(newpath.slice(-1) !== "/") CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-12-30 05:40:35 +00:00
|
|
|
var VBAFMTS = [ "xlsb", "xlsm", "xlam", "biff8", "xla" ];
|
|
|
|
|