Description: I have written a user function to obtain selected information about a document. Here it is: Function DokInfo(optional info, Optional styl) REM The function returns the document information indicated by the parameter. REM the "info" argument must be the text: REM "AutorO" - gives the author of the document. REM "Utworzony" - document creation date. REM "Zmodyfikowany" - date of last modification. REM "AutorM" - author of the last modification. REM "Ile" - Number of sessions with the document. REM "Czas" - total working time on the document. REM styl, if present, must be one of the acceptable formats REM presentation of date and / or time given as text as in the TEXT () function Dim oData As Object, oDoc As Object If isMissing(info) Or isArray(info) Then DokInfo="Zły argument" : Stop 'Bad argument If IsMissing(styl) Then styl="Standard" oDoc=ThisComponent On Local Error GoTo niemodyfikowany oDoc=oDoc.DocumentProperties info=UCase(info) With oDoc Select Case info Case "AUTORO" ' - gives the author of the document. DokInfo= .Author Case "UTWORZONY" ' - document creation date. oData=.CreationDate GoSub kiedy Case "ZMODYFIKOWANY" ' - date of last modification. oData=.ModificationDate GoSub kiedy Case "AUTORM" ' - author of the last modification. DokInfo=.ModifiedBy Case "ILE" ' - Number of sessions with the document. DokInfo=.EditingCycles Case "CZAS" ' - total working time on the document. DokInfo=Format(.EditingDuration/86400,Iif(styl="Standard","[h]:mm:ss",styl)) Case Else DokInfo="Zły argument" 'Bad argument End Select End With Exit Function kiedy: With oData DokInfo=Format(DateSerial(.Year,.Month,.Day)+TimeSerial(.hours,.minutes,.seconds),styl) End With Return niemodyfikowany: DokInfo="Dokument nie był modyfikowany" 'The document was not modified End Function If I save the function together with the document in the document container, it works fine. If a function is placed in the "My Macros" container, then after loading the file in which the function was used, it does not determine the correct information. They will appear only after the file is forced to be reloaded, or after the cell with the function is forcibly moved to another place or its contents copied (e.g. to itself). While looking for a solution to the problem, I wrote another simple function. Test function (Optional wrs, Optional kol) If isMissing (wrs) Then wrs = 0 If IsMissing (col) Then col = 0 test = thisComponent.Sheets (0) .GetCellByPosition (kol, wrs) .String End function It turns out that after loading the file, it also does not return any result if it is in the "My Macros" container and document must be reloaded for good results. What could be the reason for this action? Steps to Reproduce: 1. Add the attached function (eg test) to the "Standard" library in the "My Macros" container. 2. Create a Calc document where you will apply this feature. 3. Save the document and close it. 4. Open the document again. Actual Results: The cell containing the function displays no value (function test) or contains false values (function DokInfo). Expected Results: The result of the function should be displayed. It will only appear after reloading the file. Reproducible: Always User Profile Reset: No Additional Info: Such an action appears in many colleagues on the LibreOffice forum.
I cannot reproduce the error in: Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 0aea0cee58fe77a9058217dfdfc3d6a02b29ee2a CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: en-US (de_DE); UI: en-US Calc: CL I tried to reproduce it in this order: 1) Inserted your macro under Module 1 under Standard Macros. 2) Createda function using your function: function test Msgbox DokInfo("Utworzony") end function 3) Created a new Calc document 4) Execute the macro Are these steps correct or am I missing something?
Dear Jerzy Moruś, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
Dear Jerzy Moruś, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-FollowUp