poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: Suppressing cell errors like xlNumberAsText
Date Mon, 08 Mar 2010 08:02:50 GMT

I do not know if this is possible and I say that because the setting is not
related to the workbook but it is a global setting related to Excel itself
if I remember correctly; setting this through Excel, you would use the
Tools>Options>Error Checking menu. Also, the green triangle indicates more
than simple data type errors and would your users want to have this support
disabled?

Having said all of that, it may be possible to modify this setting through
the workbook options but I do not know this for certain and will try to
experiment a little if I have the time this week.

Yours

Mark B


Robert Tomanek-3 wrote:
> 
> Hi,
> 
>  I need to write values into Excel cells. I don't have much control
>  over these values as they come from an external source via XML (so
>  all of them are Strings).
> 
>  Most of the time it works fine for me however sometimes Excel is
>  trying to be too smart and displays the dreaded green triangles, like
>  the one for "Number Stored as Text": "The number in this cell is
>  formatted as a number or preceded by an apostrophe" -> "Convert to
>  Number" / "Ignore Error".
> 
>  I would like to programmatically (via POI) set the Ignore property
>  for cell errors to True. In VBA it looks like this:
> 
>   cell.Errors.Item(xlNumberAsText).Ignore = True
> 
>  More info:
>  http://msdn.microsoft.com/en-us/library/bb223803.aspx
> 
> http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.namedrange.errors.aspx
> 
>  How do I go about that in POI?
> 
>  Being smart about cell types (e.g. trying to detect integers and
>  write them as such) is not really an option for me -- the values from
>  the external source can have really fancy formatting and I can never
>  be sure what will trigger Excel's filters. Let alone the unneeded
>  code complexity.
> 
>  So, is there any way to set cell error ignoring in POI?
> 
> Kind regards,
> r.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Suppressing-cell-errors-like-xlNumberAsText-tp27810457p27818158.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Mime
View raw message