Tables and Ranges
Introduction
Sometimes you create a table in Microsoft Excel and do not want to keep working with the table functionality that it comes with. Instead, you want something that looks like a table. To keep data in a table without losing formatting, convert the table to a regular range of data. Aspose.Cells does support this feature of Microsoft Excel for tables and list-objects.
Using Microsoft Excel
Use the Convert to Range feature to quickly convert a table to a range without losing formatting. In Microsoft Excel 2007/2010:
- Click anywhere in the table to make sure that the active cell is in a table column.
- On the Design tab, in the Tools group, click Convert to Range.
Using Aspose.Cells
The following code snippet demonstrates the same functionality using Aspose.Cells.
workbook, _ := NewWorkbook_String("sample.xlsx") | |
worksheets, _ := workbook.GetWorksheets() | |
worksheet, _ := worksheets.Get_Int(0) | |
listObjects, _ := worksheet.GetListObjects() | |
listObject, _ := listObjects.Get_Int(0) | |
listObject.ConvertToRange() | |
workbook.Save_String("ConvertTableToRange_out.xlsx") |