Bug 111833

Summary: "This command cannot be used on multiple selection" error in XLSM macro (OK in Excel)
Product: LibreOffice Reporter: Aron Budea <aron.budea>
Component: CalcAssignee: Tamas Bunth <btomi96>
Status: RESOLVED FIXED    
Severity: normal CC: btomi96
Priority: medium    
Version: 6.0.0.0.alpha0+   
Hardware: All   
OS: All   
Whiteboard: target:6.0.0
Crash report or crash signature: Regression By:
Bug Depends on: 107902    
Bug Blocks: 108897, 108908    
Attachments: Sample XLSM

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