Ask Your Question

calc: Is there some known issues using button to execute a macro - II ?

asked 2020-03-25 14:12:42 +0200

newbie-02 gravatar image


it's like minefield potshooting, whereever i look i stumble in new strange things,

i'll try to attach a file, it contains a macro with strange behaviour,


( !!! the macro is neither well written nor 'good' or finished, it's patchworked from parts i found in the web, but: sometimes it works, and sometimes it doesn't ... !!! )

(to use the file you'll likely have to disable form-control 'design-mode' by clicking - view - toolbars - form-controls - and there uncheck 'design mode', it's neccessary when you see the push-button with 'drag-points' on it, i don't know why that point sometimes enables itself)

tested with LO calc and

issue 1: the macro in the file works fine when opening macro editor and stepping through it with F8, while it fails - doesn't paste in A12, B12 or A11:CV110 - when it's started by the push button in cell A3,

issue 2: executing the macro by tools - macros - run macro depends on the previous action, after macro editor stepthrough: run macro works, after push button: run macro fails, a sort of a 'state machine', not my idea of a reliable algorithm,

i'm interested in two things:

I. rework the macro or button to work from push button

II. why? did above issue occur? an algorithm that could work shouldn't be dependent on previous actions,

add. info: when i copy the macro code into 'my macros' i get the additional possibility to start it with an assigned keyboard shortcut, that worked better. but i'd like to have the macro 'in' the file to be able to give it to other people to meter their system in a cheap and fast way.

i've learned that similar issues struck other users, macro works but not from push button, e.g.:

thus i think there might be an issue, and not my system being 'bad'.

this question is to 'check the field' before filing a bug.



edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2020-03-25 22:04:44 +0200

Hello @newbie-02

Bug 70883 - "uno: copy" via the dispatcher does not work when a button has focus You are pasting empty cells when macro is run via button.

edit flag offensive delete link more


hello @ SM_Riga,

thanks a lot, that's the point, the trick to circumvent from: works.

there remains one reason to be sad, the systematics of the community and the bugtracker bury too many bugs as 'old', and new appearances are withdrawn from attention as 'duplicate'.

newbie-02 gravatar imagenewbie-02 ( 2020-03-26 00:07:19 +0200 )edit

the systematics of the community and the bugtracker bury too many bugs as 'old', and new appearances are withdrawn from attention as 'duplicate'

Nonsense. Duplicates and CC count gradually increase importance of bugs, thus marking a bug as a duplicate of another bug makes one important bug instead of two invisible ones. See e.g. c#88 to bug 62196. If a bug is not handled, it's not because of how bug tracker works, but because there's no interested developer. And I also saw this comment, which indicates that it's unwise to post annoyed comments like yours.

Mike Kaganski gravatar imageMike Kaganski ( 2020-03-26 05:41:01 +0200 )edit

hello @Mike,

pls. ... not again a long OT discussion,

nonsense? - no, just bug #62196 you mentioned is a good example for the evil influence of 'long time not resolved bugs'. rising priority after 6 years and 9 months is ... 'suboptimal'?

annoyed? - no, frustrated would be the right expression, i know that cheering up would be better, i also try to do it better, but i am human, humans are not perfect, and it frustrates me how an actually good project suffers from protracted bugs.

to cut a long story short, I'll be e-mailing you privately.

to keep the relevant info visible:

bug description there:

trick to circumvent problem in comment #7:

newbie-02 gravatar imagenewbie-02 ( 2020-03-26 07:55:19 +0200 )edit

To be honest, I would not even name such a behaviour as a bug. User clicks a form control, focus goes to this control. Makes sense to me. The problem is in the code, which uses some tools/functionality, but does not take into account how these tools work. Comment by Frank Schönheit explains it well. The code is messy, mixes different coding approaches and thus is not reliable and causes undesirable results. But the OP knows it. By the way, you can also control taking focus of the Push Button form contol using Take focus on Click propery.

SM_Riga gravatar imageSM_Riga ( 2020-03-26 09:57:35 +0200 )edit

thanks to @SM_Riga, very good hint, concise explanation there,

am i right:

there is another workaround?: 'for the records: workaround: Set the "Take focus in click" property of the button to "No"'

it's fixed in AAO since 2005?: 'Fixed this by not routing cut/copy/paste (and a lot of other functionalities) to the active control, if this active control cannot serve the functionality, anyway.'

proposal: pull this method / fix into LO ... ? if you agree it being possible i'll file an enhancement request for it.

newbie-02 gravatar imagenewbie-02 ( 2020-03-26 18:47:40 +0200 )edit

answered 2020-03-26 01:18:33 +0200

Captrquig gravatar image

as you step through the macro you can use the windows key + v on your keyboard to verify if the info was copied to the clipboard This is a very frustrating problem and I gave up and found a way around by getting contents of a cell and placing it in it's intended location

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-03-25 14:12:42 +0200

Seen: 368 times

Last updated: Mar 26 '20