You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Marot Laurent <La...@alliacom.com> on 2004/01/27 17:40:18 UTC

Problem with sheet reference

Hi all,

I'm facing a proble with code below:

HSSFWorkbook wb = new HSSFWorkbook(); 
HSSFSheet s = wb.createSheet();
wb.setSheetName(0,"Feuille1");
//wb.setSheetName(1,"Feuille2");
HSSFRow r = null;
HSSFCell c = null;

// Définitions
HSSFName nomTest = wb.createName();
nomTest.setNameName("myname");
nomTest.setReference(wb.getSheetName(0)+"!$A$1:$A$1");

if i comment out line //wb.setSheetName(1,"Feuille2"); everytihing works fine but if i leave it uncommented, i get an error while using to open the xls file

isn't it the right way to reference sheets ?

Thanks




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Problem with sheet reference

Posted by Danny Mui <da...@muibros.com>.
that looks right.  pop in a bugzilla with the code you have here:
http://nagoya.apache.org/bugzilla/buglist.cgi?product=POI

Marot Laurent wrote:

> Hi all,
> 
> I'm facing a proble with code below:
> 
> HSSFWorkbook wb = new HSSFWorkbook(); 
> HSSFSheet s = wb.createSheet();
> wb.setSheetName(0,"Feuille1");
> //wb.setSheetName(1,"Feuille2");
> HSSFRow r = null;
> HSSFCell c = null;
> 
> // Définitions
> HSSFName nomTest = wb.createName();
> nomTest.setNameName("myname");
> nomTest.setReference(wb.getSheetName(0)+"!$A$1:$A$1");
> 
> if i comment out line //wb.setSheetName(1,"Feuille2"); everytihing works fine but if i leave it uncommented, i get an error while using to open the xls file
> 
> isn't it the right way to reference sheets ?
> 
> Thanks
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org