Bug 148612 - Bug in a macro that cannot read cells
Summary: Bug in a macro that cannot read cells
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.1.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-StarBasic
  Show dependency treegraph
 
Reported: 2022-04-15 12:03 UTC by Frederic Parrenin
Modified: 2023-11-29 12:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
.ods file to reproduce the problem (110.66 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-04-15 12:03 UTC, Frederic Parrenin
Details
Minimal bugdoc (9.48 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-04-15 15:18 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Parrenin 2022-04-15 12:03:51 UTC
Created attachment 179584 [details]
.ods file to reproduce the problem

Steps to reproduce:
- open the attached .ods file
- edit macros
- go to macro "test_bug" and execute
=> the macro does nothing
- now remove all other macros in the module
- execute again "test_bug"
=> the macro now produces something

Do I miss something obvious or is this a bug?
Comment 1 Frederic Parrenin 2022-04-15 12:05:16 UTC
Note that in the test_bug macro, if I write:

sheets("Feuil1").cells(2,1) = "test"

it works. So LO is able to write something, but not to read.
Comment 2 Mike Kaganski 2022-04-15 15:18:38 UTC
Created attachment 179588 [details]
Minimal bugdoc

Repro using Version: 7.3.3.1 (x64) / LibreOffice Community
Build ID: 1688991ca59a3ca1c74bc2176b274fba1b034928
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: 

The attachment has minimal macro needed to reproduce the bug. Looks like having something named "cells" referenced from a sub, affects use of an object's member having the same name in another function. Renaming "cells" to anything else in "test3" makes "test_bug" function properly copy data from A1 to A2.
Comment 3 Frederic Parrenin 2022-10-26 09:47:34 UTC
A workaround to this problem is to copy "test_bug" to another module and execute it from there.
Comment 4 Frederic Parrenin 2023-11-29 12:33:17 UTC
This bug is still present in 7.5.9.