Hi,
I have LibreOffice 7.6.4.1 (I think this is the latest version) installed on Windows 10 64 bit.
I recorded a macro in LibreOffice Calc where I selected several cells,right clicked my mouse and selected copy,put my mouse pointer on an empty cell and right clicked and selected paste special number or even transpose and saved the macro.
When I opened a new document an tried running the macro,it could not reproduce the simple copy paste steps.I am shocked by this as I assumed that this is an obvious task that macros should be able to record and reproduce.
Please help me in fixing this.
Thanks
[Solved] Recorded macro doesn't perform copy paste steps
[Solved] Recorded macro doesn't perform copy paste steps
Last edited by MrProgrammer on Fri Feb 09, 2024 5:20 pm, edited 1 time in total.
LibreOffice 7.6.4.1 on Windows 10 64 bit
Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
Can you upload the recorded macro code embedded into a sample file?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
@4joey1, as this seems to be your first post, welcome to the forum.
And a few remarks:
1. The OO.o version your signature is showing is very old. So is the Win version. There may not still be many ucontributors knowing any special problems related to that combination.
2. The subject of your post mentions "LibreOffice 7.6.4.1 Windows 10 64 bit". This is inconsistent and requires clarification.
3. You didn't post earlier. If you never had an issue up to now, you also may never have used the macro recorder. It may therefore be that you expect a recorded macro to be waiting for your actions during execution, and then continuing depending on them. This is a wrong expectation. Therefore any contibutor will need to study your code before they can advise you reasonably.
And a few remarks:
1. The OO.o version your signature is showing is very old. So is the Win version. There may not still be many ucontributors knowing any special problems related to that combination.
2. The subject of your post mentions "LibreOffice 7.6.4.1 Windows 10 64 bit". This is inconsistent and requires clarification.
3. You didn't post earlier. If you never had an issue up to now, you also may never have used the macro recorder. It may therefore be that you expect a recorded macro to be waiting for your actions during execution, and then continuing depending on them. This is a wrong expectation. Therefore any contibutor will need to study your code before they can advise you reasonably.
On Windows 10: LibreOffice 24.8.3 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
- MrProgrammer
- Moderator
- Posts: 5099
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
Your forum signature is: OpenOffice 3.1 on Windows Vista. Please fix that.
I don't know what you mean by that phrase. I ignored it.
Read [Tutorial] Favorite Recorded Calc Macros. Your description sounds similar to PasteValues there. I recorded it years ago and use PasteValues many times a week.
A recorded macro cannot make, or ask you to make, any decisions. Every step in a recorded macro is a fixed, imperative action. If you record selecting the source cell and the target cell, the macro will always act on those same cells. Perhaps you don't want to do that. When I created PasteValues, I recorded only the Paste Special part so that I have flexibility in what the source and target are.
If you need the macro to be available in a new document, you must save it in My Macros, not in a Calc document.
If this solved your problem please go to your first post use the Edit ☐ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
FWIW:
In LibreOffice 7.6.4.1, the Paste Special menu contains 6 items.
In case of: "Text", "Number", "Formula" and "Transpose"
the Macro Recorder provides a commented out code.
E.g. for the "Number" item:
Code: Select all
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:PasteOnlyValue", "", 0, Array())
OpenOffice 1.1.5 – 4.1.15
LibreOffice 3.3.0.4 – 24.8
Windows 7,10,11 64-bit
LibreOffice 3.3.0.4 – 24.8
Windows 7,10,11 64-bit
Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
Cross posted at AskLibreOffice
If you cross post, as a courtesy please let us know that you have done so, otherwise it leads to several discussions and a waste of time because several identical answers may be posted by different users.
If you cross post, as a courtesy please let us know that you have done so, otherwise it leads to several discussions and a waste of time because several identical answers may be posted by different users.
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.8.3.2; SlackBuild for 24.8.3 by Eric Hameleers
---------------------
Apache OpenOffice 4.1.15
LibreOffice 24.8.3.2; SlackBuild for 24.8.3 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue
Unexpected '{' on line 32
.Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
To get recorded code to adapt its working better to your needs, you have to edit it introducing substantial changes and enhancements.
On the other hand some wanted adaptions of action are better supported by some .uno: commands than by standard API means. This seems to be the case of "pasting special" with flags.
See attached example.
On the other hand some wanted adaptions of action are better supported by some .uno: commands than by standard API means. This seems to be the case of "pasting special" with flags.
See attached example.
On Windows 10: LibreOffice 24.8.3 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
- MrProgrammer
- Moderator
- Posts: 5099
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit
But the last of the six items, Edit → Paste Special → Paste Special, does create executable code (not a comment) in the recorded macro. Thus when recording a macro don't use Text, Number, Formula, or Transpose since the last Paste Special item allows one to perform all of those four operations. The macro which I recorded with Edit → Paste Special → Paste Special → Selection:Numbers → Options:None → Operations:None → ShiftCells:Don't → OK copied the numeric value only.
I have no idea why the developers would implement these new features without providing recorded macro support. Seems to me as if there is room for improvement in the implementation of them. Generating the comment is not helpful because the recorded macro feature is designed for people who are not able to write macros using the API, that is, almost every user. Many users don't have the programming background to make even trivial changes to a recorded macro.
If this solved your problem please go to your first post use the Edit ☐ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: [Solved] Recorded macro doesn't perform copy paste steps
Amen to that!
(Ab)using the phrase from LO 7.6 Getting Started Guide (p. 429):
(Ab)using the phrase from LO 7.6 Getting Started Guide (p. 429):
You never know for certain what the macro recorder can capture until you try it.
OpenOffice 1.1.5 – 4.1.15
LibreOffice 3.3.0.4 – 24.8
Windows 7,10,11 64-bit
LibreOffice 3.3.0.4 – 24.8
Windows 7,10,11 64-bit