次のコードは、探していることを実行するはずです。
Excel.run(function(ctx) {
var rows = ctx.workbook.tables.getItem('YourTableName').rows;
rows.load("values"); // We'll need the rows values to check if they're empty.
return ctx.sync().then(function() {
// Important to go through the items in reverse fashion as deleting a row shifts the rest up.
rows.items.reverse().forEach(function(row) {
// row.values is a double array. Although, we know it can only contain one row.
var isEmpty = row.values[0].every(function(col) {
return col === "";
});
if (isEmpty) {
row.delete();
}
});
}).then(ctx.sync);
}).catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
それが役立つことを願って、
Gabriel Royer - Office Extensibility Team の開発者、MSFT