Click or drag to resize
SheetOpenTable Method
Opens the specified table and returns a Table object.

Namespace: Aceoffix.ExcelReader
Assembly: Aceoffix (in Aceoffix.dll) Version: 5.0.0.1
Syntax
public Table OpenTable(
	string RangeAddress
)

Parameters

RangeAddress
Type: SystemString

The A1-style notation is defined in Microsoft Excel. For example: A1:F8, it means a range of cells A1 through F8. The A1 cell is the cell whose row index is 1 and column index is 1. The F8 cell is the cell whose row index is 8 and column index is 6.

Note Note

Note: There is a limit that the maximum number of columns per worksheet is 676 and the maximum number of rows is 65,536 in Excel2003 and earlier versions. Please do not exceed the maximum number of columns when input the parameter of RangeAddress.

Return Value

Type: Table
Return a Table object.
Remarks
If the specified Table exists, this method will return the Table object.
Examples
The following code example shows how to use the OpenTable method to get the value of the specified table.
Aceoffix.ExcelReader.Workbook wb = new Aceoffix.ExcelReader.Workbook();
Aceoffix.ExcelReader.Sheet sheet1 = wb.OpenSheet("sheet1");

string strCompanyName = sheet1.OpenCell("CompanyName").Value; //Get the data of a cell

Aceoffix.ExcelReader.Table table1 = sheet1.OpenTable("B5:F16"); //Get the data of a table
while (!table1.EOF)
{
    string strValues = "";
    if (!table1.DataFields.IsEmpty)
    {
        for (int i = 0; i < table1.DataFields.Count; i++)
            strValues = strValues + table1.DataFields[i].Value + "&nbsp;&nbsp;";
        // Output the data to the current page. Typically, you can save them to the database.
        Response.Write(strValues + "<br>\r\n");
    }
    table1.NextRow();
}
table1.Close();
Response.Write("table1.RowCount = " + table1.RowCount.ToString());
wb.ShowPage(800, 600); // Pop up a HTML dialog to show the data of table. 
wb.Close();
See Also