java - One or more invalid names were detected in this workbook. Those invalid names have been changed to #REF -
tried refer value cell ('cd') particular cell, works fine in openoffice not works ms excel
for () { name householdrelationnamedcell = workbook.createname(); householdrelationnamedcell.setnamename("name"+ loopcounter); householdrelationnamedcell.setreferstoformula("$"+ cellreference.convertnumtocolstring(hiddencellcolumn) +"$1"); 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 error : "one or more invalid names detected in workbook. invalid names have been changed #ref!"
in ms excel 'formulas' -> 'name manager' shows valid name+'loopcounter value' reference value '=#na!'
by looking code.i have found while referring cell using $cd1$
(cd sample cell address without sheetname).
when name global (no sheet reference), "current" sheet (current reference name) assumed in openoffice org. ms excel 2007+ doesn't this. requires sheet reference (sheet1!name)
.
your code should this.
householdrelationnamedcell.setreferstoformula("'sheetname'!$"+ cellreference.convertnumtocolstring(hiddencellcolumn) +"$1");
Comments
Post a Comment