I suspect that it has something to do with Excel attempting to understand the
format when it opens the workbook.

After reading your post, I opened Excel and applied a custom format to a
cell - the four zeros in your original question. When I again went to check
the format applied to that cell, Excel had 'decided' it was a special format
that resembled a Portuguese Post Code/Telephone Number/Social Security
Number. So I am guessing - and I must emphasis that it is a guess - that
Excel finds a match for the data format you are creating in the list of
Special formats that are in-built and assumes that you 'really want' to
apply this format to the cell. As far as I know, there is no way to
circumvent this behaviour but as with everything, I could be wrong and
another list member may have the answer.

Yours

Mark B


Patil Minal wrote:
> 
> 
> Hi,
> 
> I am assigning a cell format to cells which contain numeric values. This
> cell format is being created on the fly based on the length of the value
> of the field like for number 0890 the format is '0000' and for 3454387 the
> format would be '0000000'. But in the excel, when I check the format of
> these fields they seem to be some Special format. Why would it be a
> special format and not the custom format?
> 
> - Minal.
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-Number-format-in-POI-tp25448434p25448676.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to