Insert to Named Range from datatable

I have a workbook with several named ranges. I’m trying to update the range by using ImportData to load the contents of the datatable into the sheet starting at the first cell (in all cases the range starts at 0,0). If I execute cells.ImportData(dt, 0, 0, tableoptions) the data is inserted, but the previous rows are shifted down so my range is now twice as big. I tried to do Range.ClearContents() which did clear the data, but the load still shifted down all of the blank rows. I also tried range.Clear() but that seems to do the same as the ClearRange().
Is there a way to load the datatable to the range and overwriting the existing data?

@rickmeister

Summary
The provided evidence relates to GroupDocs.Annotation Cloud API and does not contain any information about Aspose.Cells, the ImportData method, TableOptions, or how to overwrite data in a named range.

Why it happens
Because the evidence does not cover the Aspose.Cells Worksheet.Cells.ImportData functionality, we cannot verify the claim that setting TableOptions.IsInsertData = false will prevent the named range from expanding, nor can we confirm the alternative approaches suggested.

What to do next
Since the current evidence does not support the answer, you may need to:

  1. Consult the official Aspose.Cells documentation or API reference for ImportData and TableOptions to see if an “overwrite” mode exists.
  2. Look for examples or forum posts that specifically address importing a DataTable into a named range without expanding it.
  3. If you have access to the Aspose.Cells SDK, you can experiment with the TableOptions properties (e.g., IsInsertData) to determine their effect.

Until relevant evidence is available, we cannot confirm the suggested solution.

SDK version unclear — refer to the official release notes before applying this guidance.

@rickmeister,

The existing rows are moved down because the option “ImportTableOptions.InsertRows” is “true” by default. When inserting rows, the existing rows are sure to be moved downwards. This is the default/expected behavior. To cope with it for your needs, you need to set this option to “false” explicitly, so no rows are inserted anymore and it could update your existing dataset accordingly. In short, you may set “InsertRows” Boolean attribute of ImportTableOptions to “false” in code, so no new (empty) rows should be inserted.
e.g.,

ImportTableOptions tableoptions = new ImportTableOptions();
tableoptions.InsertRows = false; 
.....
cells.ImportData(dt, 0, 0, tableoptions)

Let us know if you still find the issue.