I created a feature request for this, but decided to post here also in case there is a workaround that I can use.
I need to modify an existing ListObject (Table) in an Excel file by adding new rows. I can't add a new row to the entire spreadsheet because it contains additional data (not only the ListObject) in the same rows as the where the Table is located.
Example... Columns A through Z have many rows of data and there is a Table in colunmns AB through AG. I need to add new rows ONLY to the table.
I tried to the following, but it doesn't seem to do anything.
IListObject myTable = mySheet.ListObjects;
We do not have direct support to add or remove rows and columns from table without affecting the outside range.
But we do have a workaround for deleting table rows and columns alone, without affecting the normal range. Please go through the below knowledge base article for code snippet.
We are analyzing the workaround for inserting and will share the details with you in 2 business days, on November 10th, 2023.
Thank you for looking into this Keerthi. There are a lot of nice features with Excel tables, so we use them quite heavily. A fix or workaround would be very much appreciated!
Greg, the workaround for inserting rows into a table without affecting the normal worksheet range is quite more difficult than we expected. We are still working on it and will get back to you once we find a solution.
Thank you for working on this, it's very much appreciated!
Greg, we have prepared and attached a sample to achieve your requirement. We have included workarounds for deleting the table rows and adding the table rows.