CTVector vector = vectorv.getVector();
CTVariant[] variants = vector.getVariantArray();
int sheetCount = -1;
int nameCount = -1;
for(int j = 0; j < variants.length; ++j) {
final CTVariant variant = variants[j];
if ((j & 1) == 0) { //string
String key = variant.getLpstr();
if ("Worksheets".equalsIgnoreCase(key)) {
final CTVariant variant2 = variants[++j];
sheetCount = variant2.getI4();
} else if ("Named Ranges".equalsIgnoreCase(key)) {
final CTVariant variant2 = variants[++j];
nameCount = variant2.getI4();
}
}
}
if (sheetCount >= 0 && nameCount >= 0) {
nameCount += sheetCount;