I am trying to retrieve named ranges from excel file using the apache poi plugin.
The code snippet is as given below.
I see that call WorkbookFactory.create(excelFile);
is taking a long time - about 3 seconds.
Is there a faster way of getting all the named ranges associated with excel sheet?
File excelFile = new File(filePath);
Workbook workbook = WorkbookFactory.create(excelFile);
int n = workbook.getNumberOfNames();
for (int i = 0; i < n; i++)
{
Name nameObject = workbook.getNameAt(i);
String formulaName = nameObject.getRefersToFormula();
System.out.println("Named Range is :"+formulaName);
}