Summary: | CreateScriptService("Calc") produces AttributeError: 'NoneType' object has no attribute 'createScriptProvider' | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | latgarf |
Component: | Calc | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | rafael.palma.lima |
Priority: | medium | ||
Version: | 24.2.2.2 release | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 159638 |
Description
latgarf
2024-04-15 21:42:06 UTC
Are you running this script from within a document? If so, I recommend you create a function and make it available as a script. To do this, follow the example "Creating Python script files" in the following help page: https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/sf_intro.html It would be something like: from scriptforge import CreateScriptService # This is your macro def my_script(args=None): doc = CreateScriptService("Calc") # Here you can do whatever you want with 'doc' # Here you make the macro available g_exportedScripts = (my_script, ) Now you can go to Tools - Macros - Run Macro. Under "My Macros", search the module you've just created (it will be the name of the Python file without the .py), and then you can select 'my_macro' and run it. |