10/12/2023 0 Comments Libreoffice calc python![]() ![]() Calling macros from documents that may have been created by someone else is a good way to spread viruses, so LO tries to prevent that. It is most likely a matter of permissions. ":?"įrom these results, it does not seem possible to call macros this way when they are stored in documents. However, as described in your question, this did not: scriptx = sp.getScript( The following worked for me: scriptx = sp.getScript( Is there a problem with the script URI? I don't know why I can print the script but the script provider cannot find it. _main_.ScriptFrameworkErrorException: The following Basic script could not be found: The following error is returned Traceback (most recent call last):įile "./runProjectEstimate.py", line 198, in Scriptx = sp.getScript(":?language=Basic&location=document") ![]() Msp = oor.get_context().getValueByName("/singletons/.provider.theMasterScriptProviderFactory") I get the script to with oor = OORunner() The first lines of the module printed are: Rem Attribute VBA_ModuleType=VBAModule The_takerate = the_vba.getByName("TakeRate") The_vba = the_basic_libs.getByName("VBAProject") The following code will print the basic script the_basic_libs = doc.BasicLibraries I get a desktop and open the spreadsheet with file_url = uno.systemPathToFileUrl(os.path.abspath("/path/to/file/estimation.xlsm"))ĭoc = desktop.loadComponentFromURL(file_url, "_blank", 0, oo_properties(MacroExecutionMode=4)) I am trying to automat a LibreOffice spreadsheet using Python. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |