如何使用Apache POI获取excel中所有已定义名称/范围名称的列表?
编辑:感谢@Axel Richter,下面是代码
List definedNames = new ArrayList();
definedNames = workbook.getAllNames();
Iterator<List> definedNameIterator = definedNames.iterator();
while (definedNameIterator.hasNext()) {
Name name = (Name) definedNameIterator.next();
System.out.println(name.getNameName());
System.out.println(name.getRefersToFormula());
System.out.println();
}
答案 0 :(得分:0)
List definedNames = new ArrayList();
definedNames = workbook.getAllNames();
Iterator<List> definedNameIterator = definedNames.iterator();
while (definedNameIterator.hasNext()) {
Name name = (Name) definedNameIterator.next();
System.out.println(name.getNameName());
System.out.println(name.getRefersToFormula());
System.out.println();
}