Bug 111833 - "This command cannot be used on multiple selection" error in XLSM macro (OK in Excel)
Summary: "This command cannot be used on multiple selection" error in XLSM macro (OK i...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Tamas Bunth
URL:
Whiteboard: target:6.0.0
Keywords:
Depends on: 107902
Blocks: XLSX Macro-VBA
  Show dependency treegraph
 
Reported: 2017-08-15 23:27 UTC by Aron Budea
Modified: 2017-08-16 13:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample XLSM (13.69 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2017-08-15 23:28 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-08-15 23:27:54 UTC
Open the attached Excel spreadsheet with a simple macro, and run the macro.
It's a slightly modified/extended version of attachment 133368 [details] from bug 107902 with the following changes:
- entries in A2:A5 have been reordered, so the macro doesn't select a contiguous block for (A, B, C),
- there's an additional "Selection.Copy" line in the macro.

Macro execution fails at that line with the following error:
"BASIC runtime error.
'1'

Type: com.sun.star.uno.RuntimeException
Message: That command cannot be used on multiple selection"

In Excel the macro runs fine.

Occurs in daily build 2017-08-15_01:59:49 (bebaac5eb6ebd2db3e1ea22b1630111343a9c25c) / Windows 7.
Requires commit mentioned in bug 107902 comment 4 from 2017-08-10.
Comment 1 Aron Budea 2017-08-15 23:28:50 UTC
Created attachment 135567 [details]
Sample XLSM
Comment 2 Aron Budea 2017-08-16 13:50:35 UTC
Seems fixed by the following commit, thanks, Tamas!

https://cgit.freedesktop.org/libreoffice/core/commit/?id=fd64103319a28fedb44cdc0438887914dba396cb
author		Tamas Bunth <tamas.bunth@collabora.co.uk>	2017-08-15 13:52:36 (GMT)
committer	Tamás Bunth <btomi96@gmail.com>	2017-08-16 07:02:32 (GMT)
commit fd64103319a28fedb44cdc0438887914dba396cb (patch)

oovbaapi: Allow copying of multiple selections