在此工作簿中检测到一个或多个无效名称。这些无效名称已更改为#REF
One or more invalid names were detected in this workbook. Those invalid names have been changed to #REF
尝试将单元格 ('CD') 中的值引用到特定单元格,在 OpenOffice 中工作正常但不适用于 ms excel
for () {
Name houseHoldRelationNamedCell = workbook.createName();
houseHoldRelationNamedCell.setNameName("name"+ loopCounter);
houseHoldRelationNamedCell.setRefersToFormula("$"+ CellReference.convertNumToColString(hiddenCellColumn) +"");
DVConstraint constraintHouseholdRltn = DVConstraint.createFormulaListConstraint("name"+ beneficiaryRelationVO.getId());
CellRangeAddressList addressListHouseholdRltn = new CellRangeAddressList(row, totalRows, column-1, column-1);
HSSFDataValidation validationHouseholdRltn = new HSSFDataValidation(addressListHouseholdRltn, constraintHouseholdRltn);
validationHouseholdRltn.setSuppressDropDownArrow(false);
sheet.addValidationData(validationHouseholdRltn);
loopCounter++;
}
Excel 错误:"One or more invalid names were detected in this workbook. Those invalid names have been changed to #REF!"
毫秒 excel 'Formulas' -> 'Name Manager' 显示有效名称+'loopCounter value' 但参考值为 '=#NA!'
通过查看您的 code.I 发现,当您引用单元格时,您只使用了 $CD1$
(CD 是没有 sheet 名称的示例单元格地址)。
当名称为 Global(无 sheet 引用)时,OpenOffice Org 中假定 "current" sheet(当前名称引用)。 MS Excel 2007+ 不这样做。它需要一个 sheet 引用 (Sheet1!name)
.
你的代码应该是这样的。
houseHoldRelationNamedCell.setRefersToFormula("'sheetname'!$"+ CellReference.convertNumToColString(hiddenCellColumn) +"");
尝试将单元格 ('CD') 中的值引用到特定单元格,在 OpenOffice 中工作正常但不适用于 ms excel
for () {
Name houseHoldRelationNamedCell = workbook.createName();
houseHoldRelationNamedCell.setNameName("name"+ loopCounter);
houseHoldRelationNamedCell.setRefersToFormula("$"+ CellReference.convertNumToColString(hiddenCellColumn) +"");
DVConstraint constraintHouseholdRltn = DVConstraint.createFormulaListConstraint("name"+ beneficiaryRelationVO.getId());
CellRangeAddressList addressListHouseholdRltn = new CellRangeAddressList(row, totalRows, column-1, column-1);
HSSFDataValidation validationHouseholdRltn = new HSSFDataValidation(addressListHouseholdRltn, constraintHouseholdRltn);
validationHouseholdRltn.setSuppressDropDownArrow(false);
sheet.addValidationData(validationHouseholdRltn);
loopCounter++;
}
Excel 错误:"One or more invalid names were detected in this workbook. Those invalid names have been changed to #REF!"
毫秒 excel 'Formulas' -> 'Name Manager' 显示有效名称+'loopCounter value' 但参考值为 '=#NA!'
通过查看您的 code.I 发现,当您引用单元格时,您只使用了 $CD1$
(CD 是没有 sheet 名称的示例单元格地址)。
当名称为 Global(无 sheet 引用)时,OpenOffice Org 中假定 "current" sheet(当前名称引用)。 MS Excel 2007+ 不这样做。它需要一个 sheet 引用 (Sheet1!name)
.
你的代码应该是这样的。
houseHoldRelationNamedCell.setRefersToFormula("'sheetname'!$"+ CellReference.convertNumToColString(hiddenCellColumn) +"");