There are
code examples in the
POI project for Excel formulas. The java code translates easily
into Coldfusion, as the following example shows
<cfscript>
filename= "C:\Documents and Settings\BKBK\My
Documents\jakarta_poi\excel_2003_tutorial_english.xls";
fis =
createobject("java","java.io.FileInputStream").init(filename);
workbook =
createobject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook").init(fis);
sheet = workbook.getSheetAt(1);
formulaEvaluator =
createobject("java","org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator").init(sheet,
workbook);
// suppose your formula is in B3
cellReference =
createobject("java","org.apache.poi.hssf.util.CellReference").init("B3");
//...and so on
</cfscript>
As -==cfSearching==- says, there is a POI library in
Coldfusion 8, but it is version 2.5. Unlike the current version
(3.1), the one in Coldfusion doesn't seem to contain
HSSFFormulaEvaluator, which is typically the kind of class you
would require.
There is a catch. It is generally not advisable to copy a
newer version of a JAR file into the Coldfusion lib folder when it
contains the old JAR. That is where you can use the
Javaloader. It can load
a Java class without clashing with the version in the Coldfusion
lib.
That was just to share some info about POI with you.
Unfortunately, it's impossible to use POI or the Javaloader if
you're not allowed to install code on the server.