1
Vote

Table and "Object reference not defined"

description

Hi,
 
I am starting to use ExtremeML.
"SetCellValue" works fine.
But I get an error qhen I tty to get a Table reference from the Spreadsheet.
The Table "Tabela" is defined for the whole Worksheet.
 
Does anyone know what could be the problem ?
 
I am using C# and Windows 7/Portuguese.
 
Thanks
 
using (var package = SpreadsheetDocumentWrapper.Open(Server.MapPath(ConfigurationManager.AppSettings["DiretorioExportacao"]) +
            arquivo))
{
    // OK
    var part = package.WorkbookPart.WorksheetParts["Estoque"];
    for (var row = 0; row < 10; row++)
    {
        part.Worksheet.SetCellValue(new GridReference(row, 0), "ABC");
        part.Worksheet.SetCellValue(new GridReference(row, 1), 123);
        part.Worksheet.SetCellValue(new GridReference(row, 2), DateTime.Now);
    }
 
    // ERROR : Object reference not defined for the instance of an object
    var table = package.WorkbookPart.GetTablePart("Tabela").Table;
 
    table.Fill(dtb);
}

comments