コード例 #1
0
        public static Cell XLGetCell(SpreadsheetDocument document, Sheet theSheet, string columnName, uint rowIndex)
        {
            WorkbookPart wbPart = document.WorkbookPart;
            // Retrieve a reference to the worksheet part.
            WorksheetPart wsPart = theSheet.XLPart(wbPart);

            // Use its Worksheet property to get a reference to the cell 
            // whose address matches the address you supplied.
            string addressName = columnName + rowIndex;
            Cell theCell = wsPart.Worksheet.Descendants<Cell>().Where(c => c.CellReference == addressName).FirstOrDefault();
            return theCell;
        }