Reputation: 2470
I am developing an office add-in using office.js, i have added the table using it and now i want to clear the table, i tried using deleteAllDataValuesAsync
method and this only deletes the data not the header.
https://github.com/OfficeDev/office-js-docs/blob/master/reference/shared/binding.tablebinding.deletealldatavaluesasync.md
I am trying to find out how to delete the header in table through binding or in general too
Upvotes: 1
Views: 397
Reputation: 2668
You can use a combination of the Binding and Table APIs for Excel 2016 and later:
First use the Binding.getTable() method to retrieve the table object for the table associated with your binding. Then call the delete() method on the table object.
Edit: in Excel 2013 there's no API to accomplish this action.
Upvotes: 1