I use office2007 created a xls,in Cell X1,fill foregroundcolor is RGB(79,129,189). But when I use HSSFWorkbook open this xls and getCustomPalette,In return HSSFPalette object can't found Color RGB(79,129,189). java code as follows: HSSFWorkbook wb; FileInputStream finput=null; File file; file = new File("D:\\mysoft\\rpsp-sample\\testfile\\testcopycell.xls"); try { finput = new FileInputStream(file); wb = new HSSFWorkbook(finput); HSSFPalette palette = wb.getCustomPalette(); System.out.print(palette); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ try { finput.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Created attachment 25412 [details] for fixbug d
Your file really doesn't seem to have a cell with that color. Opening open the file, I see the dark blue is 51,51,153 (X1) and the light blue is 153,229,229 (Y1). So, poi won't find the color you mentioned, because it isn't there...
(In reply to comment #2) > Your file really doesn't seem to have a cell with that color. > Opening open the file, I see the dark blue is 51,51,153 (X1) and the light blue > is 153,229,229 (Y1). So, poi won't find the color you mentioned, because it > isn't there... You certitude open that xls with office2007? I upload the intercept picture
Created attachment 25543 [details] a xls cell foreground intercept picture
In your screenshot, I can see your excel claiming the colour is 79/129/189. Loading the screenshot into an image program I can confirm that the colour shown really is 79/129/189 However, when I load the excel file up, the blue I see isn't the same blue that was in your screenshot. I see a darker blue of 51,51,153. Looking in the excel file at the palette records, the colour really is defined as 51,51,153. The colour 79,129,189 isn't in the palette. So, I think there must be something very odd going on with your copy of excel. It is showing you one colour, but recording a quite different one. Not sure what we can do to help here - if the colour doesn't get put in the file, we can't read it back out again...