Reading and Writing Query Table of Worksheet

Reading and Writing Query Table of Worksheet

The following sample code reads the first QueryTable of the first worksheet and then prints both of the QueryTable properties. Then it sets the QueryTable.PreserveFormatting to true.

You can download the source Excel file used in this code and the output Excel file generated by the code from the following links.

Console Output

Here is the console output of the above sample code

Adjust Column Width: True

Preserve Formatting: False

Retrieve query table result range

Aspose.Cells provides option to read the address i.e. result range of cells for a query table. Following code demonstrates this feature by reading the address of result range for a query table. Sample file can be downloaded here.