Description: In the SourceForge Macro Library, SFDocument.Form.Controls("ControlName") method fails in a Calc document when a control name parameter is given and the sheet that the control is on is NOT the active sheet. Note that the method works properly when no Control name is given. Also note thet the Subforms("SubFormName") method works fine whether or not the containing sheet is active. Steps to Reproduce: 1. In a calc sheet, create DB Form with controls and a subform 2. Retrieve the SF Form object 3. Ensure a different sheet is Active 4. Execute the SFDocument.Form.Controls("ControlName") method, naming the control 5. Observe the failure Actual Results: SFDocument.Form.Controls("ControlName") method fails with the following MessageBox contents: Library : SFDocuments Service : Form Method : Controls The ScriptForge library has crashed. The reason is unknown. Maybe a bug that could be reported on https://bugs.documentfoundation.org/ More details : Location : SFDocuments.Form.Controls/637 An exception occurred Type: com.sun.star.container.NoSuchElementException Message: . THE EXECUTION IS CANCELLED. Expected Results: Normal execution, whether or not the containing sheet is active Reproducible: Always User Profile Reset: No Additional Info: 1. SFDocument.Form.Controls("") works and returne the full control list, whether or not the containing sheet is active. 2. SFDocument.Form.Subforms("SubFormName") works and returns the SubForm Object, whether or not the containing sheet is Active. 3. SFDocument.Form.Controls("ControlName") works if the containing sheet is first made active.
In the deacription section, the first line reading "In the SourceForge Macro Library.....". That should read "In the ScriptForge Macro Library....."
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
I am unable to reproduce this bug. I created a Calc file and added a Table control to Sheet1. Then I added 2 more sheets and from Sheet3 I called the following macro: Sub TestForm GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") oDoc = CreateScriptService("Document", ThisComponent) oForm = oDoc.Forms("Sheet1", "Form") oControl = oForm.Controls("Table1") MsgBox oControl.Name End Sub The macro worked fine. Can you please confirm that the bug persists? System info Version: 7.6.4.1 (X86_64) / LibreOffice Community Build ID: 60(Build:1) CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Ubuntu package version: 4:7.6.4-0ubuntu0.23.10.1 Calc: threaded
This bug has been in NEEDINFO for 3 months now. I'm closing this due to insufficient data. Fell free to reopen if you have anything new to add.