On Sun, Mar 03, 2013 at 08:57:49AM -0600, Larry Evans wrote: > and the calc window opened. I then put macros security at medium, and then > loaded the attached .ods file, and then created a macro containing the > previously attached NumberFive.bsh. I was able to save it this time; > however, > when I tried to run it, I got an Error window with a pink octagon and red > X and the message: > Sourced file: inline evaluation of : ``import > com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XcomponentContext; > i...": Not an array > So obviously it's not interpreting the file as java. I've again attached > the file. What am I doing wrong?
Are you running the macro from "Tools" - "Macros" - "Run Macro..." / "Tools" - "Macros" - "Organize macros" - "BeanShell..." - "Run"? or are you running the macro from the "editor"? If from the editor, try putting debug(); at the top of the editor, to see what's happening (I guess a null pointer exception), remove debug(); before storing the file. This file as a macro that runs fine: http://people.apache.org/~arielch/api/BeanShell.ods The ODS you attached on the other mail has code that work only with Writer: xTextDoc = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,oDoc); xText = xTextDoc.getText(); xTextRange = xText.getEnd(); xTextRange.setString( "Hello World (in BeanShell)" ); Regards -- Ariel Constenla-Haile La Plata, Argentina
pgpVMuqcbDujx.pgp
Description: PGP signature