javascript - Clear a sheet in Excel 2013 with office add-ins -
i have office add-in generates report (tables). second time user running want clear sheet.
i have been trying around , have read through documentation cant find way this.
have found solution solve this?
use sheet.getrange().clear()
method.
example:
excel.run(function (ctx) { var sheet = ctx.workbook.worksheets.getactiveworksheet(); sheet.getrange().clear(); return ctx.sync(); }).catch(function(error) { console.log("error: " + error); if (error instanceof officeextension.error) { console.log("debug info: " + json.stringify(error.debuginfo)); } });
~ michael zlatkovsky, developer on office extensibility team, msft
Comments
Post a Comment