Bug 170461 - Calc,API: Cells function only enumerates cells in the first sheet
Summary: Calc,API: Cells function only enumerates cells in the first sheet
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.5.9.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro
  Show dependency treegraph
 
Reported: 2026-01-24 16:16 UTC by nobu
Modified: 2026-01-28 19:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ods (11.40 KB, application/vnd.oasis.opendocument.spreadsheet)
2026-01-24 16:16 UTC, nobu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nobu 2026-01-24 16:16:10 UTC
Description:
Cells function only enumerates cells in the first sheet.

Steps to Reproduce:
1. Open sample Calc file.

'File contains following basic macro
Sub Cells_Test()
 Dim sels As Object, cell As Object
  sels = ThisComponent.CurrentSelection
  MsgBox sels.AbsoluteName & Chr(10) & sels.Count
  For Each cell In sels.Cells
    MsgBox cell.AbsoluteName
  Next cell
End Sub

2. Select two sheets (AAAA and BBBB) and select Cell A1.
3. Run Macro.

Actual Results:
4. The first message confirms that cells from both sheets have been retrieved, but the subsequent message only lists cells from the first sheet.

Expected Results:
4. All selected cells will be listed.


Reproducible: Always


User Profile Reset: No

Additional Info:

Reproducible
[2026-01-24]
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 680(Build:0)
CPU threads: 4; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: CL threaded

Reproducible
Version: 7.5.9.2 (X86_64) / LibreOffice Community
Build ID: cdeefe45c17511d326101eed8008ac4092f278a9
CPU threads: 4; OS: Windows 10.0 Build 26100; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded
Comment 1 nobu 2026-01-24 16:16:48 UTC
Created attachment 205159 [details]
Sample ods
Comment 2 Werner Tietz 2026-01-24 18:47:39 UTC
Confirmed with

```
Version: 25.2.3.2 (AARCH64) / LibreOffice Community
Build ID: 520(Build:2)
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: en-GB
Debian package version: 4:25.2.3-2+deb13u3
Calc: threaded
```
and
```
Version: 25.8.4.2 (AARCH64)
Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
```