Description: Since I updated to the new version of LibreOffice (6.3.1.2, buildID: 1:6.3.1~rc2-0ubuntu0.18.04.1~lo1) every time I open my spreadsheet with macros I get a "BASIC Runtime Error - Object Variable Not Defined". This only happens when opening the sheet, when I execute the function (not a sub) manually, it works. In my function I operate a lot on cells, my guess is that in the new version, the sheets and cells are not ready yet. Worked before in version 6.0.something I tested it with "normal" functions that don't rely on the ThisComponent, those work fine. FILEOPEN Steps to Reproduce: 1. Open a file with a macro that uses ThisComponent 2. Enable Macros Actual Results: BASIC Runtime Error Object Variable Not Set Expected Results: Execute the function without errors Reproducible: Always User Profile Reset: No Additional Info:
Would it be possible you attach the file so we can try to reproduce this? Have a look at https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission first.
Created attachment 154892 [details] File with the macro Here's the file. Note that the macro takes in two strings to access cells on a different sheet, I have only included the function-call and the second sheet. Return is in German.
i can even reproduce the problem with attached file with: Version: 5.4.7.2 (x64) Build-ID: c838ef25c16710f8838b1faec480ebba495259d0 CPU-Threads: 4; BS: Windows 6.19; UI-Render: Standard; Gebietsschema: de-DE (de_DE); Calc: single but not with: LO 4.4.7.2 AOO 4.1.5 i think this issue could be a duplicate of: Bug 123005 - FILEOPEN: Error on creating getCurrentController().getActiveSheet() for basic script from location=document cause "Document.CurrentController" reports is Null 'Get Sheet object If Not IsMissing(startingSheetName) And Document.Sheets.hasByName(startingSheetName) Then msgbox isnull(Document.CurrentController) If startingSheetName = Document.CurrentController.ActiveSheet.Name Then
Created attachment 154908 [details] bt with debug symbols On pc Debian x86-64 with master sources updated today, I got an error message too. I attached a bt corresponding to the moment I get the error.
Dear p_consti, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
repro with: Version: 7.4.1.2 (x64) / LibreOffice Community Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0 CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: default
I gave a new try with master sources updated today and could reproduce this. After having added some debug traces, I found that the pb was in last line of this block: Function setupKOSheet(startingSheetName AS String, startingCell as String, Optional numParticipants As Integer, _ Optional vertSpacing As Integer, Optional horSpacing As Integer, Optional nameWidth As Integer, Optional redColor, Optional blueColor) Dim Document As Object Document = ThisComponent 'Get Sheet object If Not IsMissing(startingSheetName) And Document.Sheets.hasByName(startingSheetName) Then If startingSheetName = Document.CurrentController.ActiveSheet.Name Then Indeed "Document" seems not exist at this moment. (it would confirm the initial description) Now if I go to the first sheet "Befehle" in A6 and do a recalculate, it works. (this sheet contains =SETUPKOSHEET("Beispiel";"C2";16)) I wanted to know how the macro was launched at the start, so searched in Tools/Customize/Events and found nothing. It's after a while I saw it was in a formula. Mike/Andreas: thought you might be interested in this one.
Bug still occurs on 24.2.5.2 and 24.8.1.2, tested on Ubuntu 24.04
*** This bug has been marked as a duplicate of bug 123005 ***