excel - Using XLLoop for java -
xlloop opensource framework java. example can use function java in excel. below simple example of usage:
package org.boris.xlloop.util; import org.boris.xlloop.functionserver; import org.boris.xlloop.handler.*; import org.boris.xlloop.reflect.*; public class serverexample { public static void main(string[] args) throws exception { // create function server on default port functionserver fs = new functionserver(); // create reflection function handler , add math methods reflectfunctionhandler rfh = new reflectfunctionhandler(); rfh.addmethods("math.", math.class); rfh.addmethods("math.", maths.class); rfh.addmethods("csv.", csv.class); rfh.addmethods("reflect.", reflect.class); // create function information handler register our functions functioninformationhandler firh = new functioninformationhandler(); firh.add(rfh.getfunctions()); // set handlers compositefunctionhandler cfh = new compositefunctionhandler(); cfh.add(rfh); cfh.add(firh); fs.setfunctionhandler(new debugfunctionhandler(cfh)); // run engine system.out.println("listening on port " + fs.getport() + "..."); fs.run(); } }
i understand , programm working. if go excel, isn't working. try:
=fs("math.random") =math.random()
but got #name?
twice
so suppose should make yet. tell me step step how configure excel , java this? should xlloop-0.3.2 (microsoft excel xll add-in) file ?
i tried running code , got following output.
all had launch excel , add xlloop addin.
- . press
alt+g
or click ongo
button beside manage excel add-ins. - . click on browse , provide path
xlloop-0.3.2.xll
file. if had downloadedxlloop-0.3.2.zip
,extract , find inside/xlloop/bin
hope helps.
edit:
launch excel.
start server(run
main
class) , test formulas.
i tested following 2(typed them on excel formula bar , hit/press enter) , worked fine. :)
- =fs("math.sin", 3.14)
- =fs("math.random")
Comments
Post a Comment