The following Basic script based on ScriptForge is crashing for no apparent reason: Sub OpenFormDocument GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") Dim oDatabase As Object oDatabase = CreateScriptService("Database", "/path/to/file/database.odb") oFormDoc = oDatabase.OpenFormDocument("Produtos") oForm = oFormDoc.Forms(0) oForm.MoveFirst() End Sub Note that it uses the FormDocument which became available in LO 7.6. However it crashes while calling MoveFirst from the Form service. These are the details of the crash as proviced by ScriptForge itself: Location : SFDocuments.Form.MoveNext/923 An exception occurred Type: com.sun.star.sdbc.SQLException Message: Function sequence error. at /home/rafael/Programming/libreoffice/connectivity/source/commontools/dbexception.cxx:358.
The bug is confirmed. It happens when a move (last(), first(), next()) within the form's resultset is done from a Basic script immediately after the opening of the document containing the form. The insertion of a Wait 1 statement prevents the occurrence of the incident by interrupting very shortly the Basic process. A patch is being prepared.
Jean-Pierre Ledure committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/84bc3ffcf5c570f044843125552589456b07f5a1 ScriptForge - fix tdf#156836 Abort on MoveFirst() It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Jean-Pierre Ledure committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/57d492a77143e9cc25e6ab6f292d184ff2f0c108 ScriptForge - fix tdf#156836 Abort on MoveFirst() It will be available in 7.6.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Still error on 7.6.1 rc2
Please check if the error still occurs in the 7.6.1.2 release, which is today the official downloadable "fresh" release. The 7.6.1.2 release contains anyway the patch.
Created attachment 189683 [details] Error when run python macro: not found scriptforge Still get error Version information: Version: 7.6.1.2 (x86_64)/LibreOffice Community Environment: CPU threads: 4; OS: Linux 6.5 User Interface: UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Misc: Ubuntu package version: 4:7.6.1_rc2-0ubuntu2 Calc: threaded
7.6.0.3 runs smooth on window
(In reply to PHAM XUAN TIEN from comment #6) > Created attachment 189683 [details] > Error when run python macro: not found scriptforge > > Still get error > Version information: > Version: 7.6.1.2 (x86_64)/LibreOffice Community > Environment: CPU threads: 4; OS: Linux 6.5 > User Interface: UI render: default; VCL: gtk3 > Locale: en-US (en_US.UTF-8); UI: en-US > Misc: Ubuntu package version: 4:7.6.1_rc2-0ubuntu2 > Calc: threaded The error message claims about the absence of the scriptforge.py module. The file is normally located in $INSTALL/program Check your installation, your python path, ... ? Anyway, IMO, the observed behaviour has nothing to do with the current bug report.
Still got error with 7.6.1 rc1 (In reply to Jean-Pierre Ledure from comment #8) > (In reply to PHAM XUAN TIEN from comment #6) > > Created attachment 189683 [details] > > Error when run python macro: not found scriptforge > > > > Still get error > > Version information: > > Version: 7.6.1.2 (x86_64)/LibreOffice Community > > Environment: CPU threads: 4; OS: Linux 6.5 > > User Interface: UI render: default; VCL: gtk3 > > Locale: en-US (en_US.UTF-8); UI: en-US > > Misc: Ubuntu package version: 4:7.6.1_rc2-0ubuntu2 > > Calc: threaded > > The error message claims about the absence of the scriptforge.py module. > The file is normally located in > $INSTALL/program > > Check your installation, your python path, ... ? > > Anyway, IMO, the observed behaviour has nothing to do with the current bug > report. Still got error with 7.6.2 rc1 I upgrade by: sudo add-apt-repository ppa:libreoffice/ppa sudo apt update sudo apt upgrade
I discovered today that Ubuntu has recently decided to build a separate package for the scriptforge/python interface, called python3-scriptforge Probably it should be installed separately in your environment. Anyway this should be reported in a separate bug report. It has nothing to do with the actual one.