You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Matthias Ramm <ma...@gmx.de> on 2006/05/18 21:02:12 UTC

Can't assign my user-defined-functions

Hi, 

here’s my call-user-defined-functions problem.

I want to use POI to generate complex planning sheets with more than standard
functions (more than SUM, SUMIF,….etc.). 
Because of the restrictions in adding functions I wrote a workbook template that
can be easily copied with all my functions in it.

So far, so good.
Most parts work fine, like copying the template an keeping my own functions in
the new file,  because I can see them.

But I can’t assign my formulas to a cell with POI. 
In JAVA it seems to work. But when I open the workbook, Excel corrupts with an
error.

I isolated a very simple function - called MyFive() - for testing with the same
result:

   Function MyFive()
    MyFive = 5    
   End Function

I can’t  assign via : cell.setCellFormula("MyFive()").
When I assign the formula afterwards manually, it works. That’s why I assume it
  visible.

What I tried out: 
- SUM is absolute no problem and works fine.
- Every case of upper and lower case writings, 
  like ‘MYFIVE’, ‘myfive’ and so on.
- Putting the workbook name in front of MyFive leads to a ParserError:
  ”[WB]!MyFive()”,”’WB’!MyFive()”,”WB!MyFive()”
- The problem exists with release POI 2.5.1 as well as the actual HEAD.
- The problem occurs in EXCEL 2000 as well as in Office2003.


maybe somebody can help me,
thanks in advance
Matthias




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/