Description: "ThisComponent.CurrentController.ActiveSheet" does not work when the file loads. The error message is "CurrentController does not exist". Before update on 2019/1/26, it worked. Steps to Reproduce: 1.write "=Vsr( CELL("COL",A5), CELL("ROW",A5) )" into the Cell A5 2.write any value, e.g. 555, into the any Cell below A5 3.save the file 4.load the file Actual Results: error "BASIC ランタイムエラー(BASIC Runtime Error) 次のプロパティまたはメソッドが見つかりません:getCurrentController。 (Can't find the next property or method : getCurrentController.)" error-no:423 Expected Results: Cell A5 shows the value, e.g. 555. Reproducible: Always User Profile Reset: Yes Additional Info: 'Macro######## Function Vsr0( ax As Variant,ay As Variant ) As Variant rem Search NON-NULL Cell and RETURN the Numeric value rem e.g. =Vsr( CELL("COL",A5), CELL("ROW",A5) ) on error goto error_vsr0 Dim oDoc, oCtrl, oSheet As Object oDoc = ThisComponent oCtrl = oDoc.getCurrentController() oSheet = oCtrl.ActiveSheet 'or' oSheet = ThisComponent.CurrentController.ActiveSheet rem addr:1〜 ; index:0〜'i=ax-1 : j=ay-1 dim i, j As Variant i=ax-1 j=ay ' look the value below 1 line; 1行下から値を見る Dim oCell, t4R As Object Dim ans, a As Variant ans="" a=0 jLmt = iif(jLimit>0, jLimit, 500) jx =j+jLmt do oCell = oSheet.getCellByPosition(i,j) a = oCell.Value ans = oCell.String j=j+1 if j>jx then' exit do end if loop while isNull(ans) OR ans = "" goto ok_vsr0 error_vsr0: print( "error-line:"& erl & ", err:" & err & chr$(10) & error$ ) stop ok_vsr0: Vsr0=a end Function '########
Please copy the information from the Help > About box and add it here.
Where is your macro located? Inside a document or in "My Macros & Dialogs" library 'Standard' or in a different library or somewhere else? When is your macro called?
may related to https://bugs.documentfoundation.org/show_bug.cgi?id=122545 FILEOPEN: Error on creating script provider for Python script from location=document ?
(In reply to Regina Henschel from comment #1) > Please copy the information from the Help > About box and add it here. Comment 1 Regina Henschel 2019-01-28 14:30:50 UTC Sorry for late. [Ans[ バージョン: 6.1.4.2 Build ID: 1:6.1.4-0ubuntu0.18.10.1 CPU threads: 4; OS:Linux 4.18; UI render: default; VCL: gtk3_kde5; ロケール: ja-JP (ja_JP.UTF-8); Calc: group threaded ] (Today, I've installed the newest one without the Language-pack ja_JP. ) [ Version: 6.2.0.2 Build ID: 2ce5217b30a543f7666022df50f0562f82be0cff CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: kde5; Locale: ja-JP (ja_JP.UTF-8); UI-Language: en-US Calc: threaded ]]
Created attachment 148758 [details] Document with the macro given in the report I have put your macro into a document. That makes it easier to reproduce the error. Open the attached document. The error message pops up. If the document is loaded, the macro works. You need to use a hard recalculate to call it when you change content in column A.
It is OK in Version: 6.0.7.3 (x64) Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5 CPU threads: 8; OS: Windows 10.0; UI render: default; Locale: de-DE (en_US); Calc: CL It fails in Version: 6.1.4.2 (x64) Build ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3 CPU threads: 8; OS: Windows 10.0; UI render: default; Locale: de-DE (en_US); Calc: CL
reproducible with Version: 6.1.5.1 (x64) Build-ID: f18954c1ba9116b85c32b6bdbc0188d3e0fd24c7 CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; Gebietsschema: de-DE (de_DE); Calc: group threaded
This seems to have begun at the below commit. Adding Cc: to Vasily Melenchuk ; Could you possibly take a look at this one? Thanks 5d007cfc8733799cf0535eac3e482eb8cae4b908 is the first bad commit commit 5d007cfc8733799cf0535eac3e482eb8cae4b908 Author: Jenkins Build User <tdf@pollux.tdf> Date: Fri Jun 8 00:50:11 2018 +0200 source 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b author Vasily Melenchuk <Vasily.Melenchuk@cib.de> 2018-04-06 20:19:10 +0300 committer Thorsten Behrens <Thorsten.Behrens@CIB.de> 2018-06-08 00:47:06 +0200 commit 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b (patch) tree 3a3372525645775c32721e59ce8c205c8f474ffd parent 2a7f74900fb646235b74d4c9bd4690e44edc3ed4 (diff) tdf#62268: allow row height recalculation on document load
(In reply to Regina Henschel from comment #2) > Where is your macro located? Inside a document or in "My Macros & Dialogs" > library 'Standard' or in a different library or somewhere else? > When is your macro called? [[ in "My Macros & Dialogs" library 'Standard'; it's called on loading a file which calls macro. At Version: 6.1.4.2 err:423 次のプロパティまたはメソッドが見つかりません:getCurrentController。 ]] At 6.2.0.2 [My Macros & Dialogs[ error-line:86, err:423 Property or method not found: CurrentController. error-line:34, err:423 Property or method not found: getCurrentController. ]] At 6.2.0.2 [file-macro[ error-line:86, err:91 Object variable not set. ]] ((''source Dim oDoc, oCtrl, oSheet As Object oDoc = ThisComponent oCtrl = oDoc.getCurrentController() REM <==== error line:34 oSheet = oCtrl.ActiveSheet ''~~~ another Function ~~~~~ Dim oDoc, oCtrl, oSheet As Object oSheet = ThisComponent.CurrentController.ActiveSheet REM <==== error line:86 ))
(In reply to Oliver Brinzing from comment #3) > may related to > > https://bugs.documentfoundation.org/show_bug.cgi?id=122545 > FILEOPEN: Error on creating script provider for Python script from > location=document ? #---------------------------------- Calcurate 計算式 Iterative References ■ Iterations 反復 Steps 100 Minimum change: 0.001 General Calculations ■ Automatically find column and row labels 行と列のラベルを自動的に検索 Formula 数式 Detailed Calculation Settings 詳細な計算の設定 XX NG XX● Default settings デフォルト設定 ○ Custom (conversion of text to numbers and more): ユーザー定義 ↓ OK ○ Default settings デフォルト設定 ● Custom (conversion of text to numbers and more): ユーザー定義 Recalculation on File Load ファイル読み込み時に再計算 Excel 2007 and newer: Always recalculate 常に再計算する ODF spreadsheet (not saved by LibreOffice): Always recalculate 常に再計算する
@ LibreOffice [[ Version: 6.2.0.3 Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62 CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: kde5; Locale: ja-JP (ja_JP.UTF-8); UI-Language: en-US Calc: threaded ]] The error-boxes were not appeared. But the macro wasn't evaluated. ((Older version of LibreOffice evaluated recursively, so it showed correct values.)) A sample spread-sheet for Debug; "_DeBug2_price-sample_dollar.ods" can be download from HERE↓ vvvvvvvvvvv (This doesn't include the macro but call it.) >https://drive.google.com/open?id=1sI1eU3FdMCr9CmCr-zVFsyfLsUEyBENp
*** Bug 123275 has been marked as a duplicate of this bug. ***
*** Bug 123764 has been marked as a duplicate of this bug. ***
Bug still exists with LO 6.2.3.2 Win10-1809
*** Bug 125042 has been marked as a duplicate of this bug. ***
if recalculation on File Load for ODF files is set to Always Recalculate in Tools/Options.../LibreOffice Calc/Formula the problem can also be reproduced in Version: 5.2.0.0.alpha1+ Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; Locale: ca-ES (ca_ES.UTF-8) and Version: 4.3.0.0.alpha1+ Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e thus, this is not a regression per se. 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b just made this problem more visible
Dear Taka~ TIDA, 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
-bug still exists on version: Version: 7.4.1.2 (x64) / LibreOffice Community Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0 CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL Edition Windows 10 Pro Version 21H2 Installed on 2020-07-12 OS build 19044.2006 Experience Windows Feature Experience Pack 120.2212.4180.0 -bug is a regression on version 6.1.4.2 released Dec 2018 -Ref: 123275 marked as dupe
I would say, that this is not a bug. UDFs (user-defined functions) should not operate on things like controllers, active sheets, etc; they are expected to take data, digest it, and output data. Relying on other data not directly mentioned in the formula is basically breaking the assumptions ... so indeed, there might be no controller when the function is executed (and the load time is just one example; the document may also be opened in headless configurations, etc).