mike@RPI4b3:~> uname -a
Linux MikesPI 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
LO Calc:
Version: 7.4.7.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: x11
Locale: en-US (C); UI: en-US
Raspbian package version: 4:7.4.7-1+rpi1+deb12u5
Calc: threaded
A quick little menu takes an array of strings that are function names
passes that string to JohnSun’s runMacro().
In the code “oModuleNames = oLib.getElementNames()” returns this array: ( explorations, See, play, sheet3ex, listBoxEx, Inspect, chart, rangeWalk ).
The first time through the loop when macroName =
“vnd.sun.star.script:explore.explorations.lineChartDo?language=Basic&location=document”
“oScript = oScriptProvider.getScript(macroName)”
throws an error exectuion jumps to NextIteration: and tries again.
The second time through macroName =
“vnd.sun.star.script:explore.See.lineChartDo?language=Basic&location=document” and rather than jumping to
NextIteration: execution stops with this error message.
“BASIC runtime error.
An exception occurred
Type: com.sun.star.script.provider.ScriptFrameworkErrorException
Message: The following Basic script could not be found:
library: ‘explore’
module: ‘See’
method: ‘lineChartDo’
location: ‘document’
at ./scripting/source/basprov/basprov.cxx:365.”
This menu using runMacro() did work until I shuffled things around a bit. Trying to get organized I put runMacro() in a separate module along with rangeWalk() which uses it, put “lineChartDo” in a “charts” module with some other chart routines. Having routines writing to different sheets I collected some of them into their own module but they are all in the “explore” library under “explorations.ods”.
runMacro() can be found here:
I can post the menu code if anyone is interested.
At the moment I’ve not a clue why the “On Local Error GOTO” fails so any pointers would be appreciated.
Happy Friday the 13th and be well.
Thanks,
Mike