Created attachment 201466 [details] PushButton + Macro = No Paste special ! PushButton and Macro. The macro detects the last line of the table, copies the contents, then adds a line at the end of the table and performs a “Paste Special” of the format and formulas. 1st case: Immediately after opening the file, if the macro is run from the ‘run macro’ menu or from the ‘Ctrl A’ keyboard shortcut, the line is added and the formula is present in the balance column. Everything is fine. 2nd case: However, if this macro is run using the Push Button immediately after opening the file, the line will be added and the format will be pasted, but not the formula! 3rd case: After opening the file, if I run the macro once with the ‘run macro’ command or the keyboard shortcut, I can use the button and the formula will be pasted. There is a conflict between the button and the macro. The macro must first be run once to use the button without the ‘Paste Special’ function bug. See file : Account_macro.ods
I think the copy failed. dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
(In reply to Saburo from comment #1) > I think the copy failed. > dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array()) Copying only fails when the pushbutton is used first, otherwise copying works perfectly. There is a conflict between the pushbutton and the formula copy. The pushbutton cannot be used with all macros.
The first version where the push button did anything is 5.0 and there the problem was already seen. Tested with Windows bibisect repo. Arch Linux 64-bit Version: 26.8.0.0.alpha0+ (X86_64) Build ID: 640a35801612123fa503fa72e8732cfb7e75caca CPU threads: 8; OS: Linux 6.18; UI render: default; VCL: gtk3 Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: CL threaded Built on 23 December 2025
repro Version 4.0.5.2 (Build ID: 5464147a081647a250913f19c0715bca595af2f) not repro Version 4.0.0.1 (Build ID: 527dba6f6e0cfbbc71bd6e7b88a52699bb48799) bibisected with linux-41max commit 7fd1cc18130464a9f09cb7a866e88c4d52e4716d author Lionel Elie Mamane fdo#63695 revert hackish fix to i#51621 *** Macro fix by gemini - document = ThisComponent.CurrentController.Frame + ThisComponent.CurrentController.Frame.ContainerWindow.setFocus + document = ThisComponent.CurrentController.Frame
(In reply to Saburo from comment #4) > repro > Version 4.0.5.2 (Build ID: 5464147a081647a250913f19c0715bca595af2f) > > not repro > Version 4.0.0.1 (Build ID: 527dba6f6e0cfbbc71bd6e7b88a52699bb48799) > > bibisected with linux-41max > commit 7fd1cc18130464a9f09cb7a866e88c4d52e4716d > author Lionel Elie Mamane > fdo#63695 revert hackish fix to i#51621 Ah, good catch. That commit is when the button stopped working completely. I think we can close as dupe of bug 70883 The current state appeared in 5.0 with 285b5ef45817fe20d3bf9613e0247d395b7c880d Calc: Insert row/col before/after [2/2] *** This bug has been marked as a duplicate of bug 70883 ***