在wps表格js编辑器内可以运行:
function js代码插入2()
{
//js代码模块控制器
var aa=Application.JSIDE.ActiveJSProject.JSComponents;
//js模块新建并命名
var bb=aa.Add(1); bb.Name="模块1";
//js代码写入模块内
bb.CodeModule.AddFromString("function aa(){console.log(444)}");
ActiveCell.Formula2="={11,22,33}";
ActiveCell.Offset(1,0).Activate();
console.log(2222);
//js代码运行调用
Run("aa");
//js模块删除移除
aa.Remove(bb);
}