//Get all names of *all* the cells in *all* the ranges
Map<String,Cell> allCells =updatedValues.getAllCells();
for (int namedCellIdx = 0; namedCellIdx < numberOfNames; namedCellIdx++) {
HSSFName aNamedCell = wb.getNameAt(namedCellIdx);
// retrieve the cell at the named range and test its contents
AreaReference aref = new AreaReference(aNamedCell.getReference());
CellReference[] crefs = aref.getAllReferencedCells();
for (int thisCellinRange = 0; thisCellinRange < crefs.length; thisCellinRange++) {
HSSFSheet sheet = wb.getSheet(crefs[thisCellinRange]
.getSheetName());
HSSFRow r = sheet.getRow(crefs[thisCellinRange].getRow());
// Get the cell that is referred to
HSSFCell excelCell = null;
if (r != null) {
excelCell = r.getCell(crefs[thisCellinRange].getCol());
// Check that the range name is on our list
String cellHandle = Range.getUniqueCellName(aNamedCell
.getNameName(), thisCellinRange);
if (allCells.containsKey(cellHandle)) {
CellConvertor.convertCellToExcel(wb, excelCell,