Macros unable to reproduce copy paste steps in LibreOffice 7.6.4.1 Windows 10 64 bit

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

Could you please try again, but this time, use Ctrl-c to copy and Ctrl-v to paste. Also, the macro recorder cannot handle non-rectangular ranges in this situation.

Thanks @Steph1.Actually using Ctrl-c to copy and Ctrl-v to paste works but unfortunately I am not doing a basic copy paste step but wanted to paste special and transpose numbers.Is there a way I can transpose using keyboard buttons that can be captured by macros or another transpose alternative that macros can capture?

Thanks

Cross posted on OpenOffice forum.

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.

Attention, the copy can only be one cell or one area, if it is several cells or non-continuous areas, the copy and paste must be done one by one.

Two macros, one for Copy (really the same like Ctrl+C), one for Paste Special. Select your range and run 1st one, then you can run 2nd one in new document.

Sub myCopy
	dim document as object, dispatcher as object
	document=ThisComponent.CurrentController.Frame
	dispatcher=createUnoService("com.sun.star.frame.DispatchHelper")
	dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
End Sub

Sub myPasteSpecial
	dim document as object, dispatcher as object
	document=ThisComponent.CurrentController.Frame
	dispatcher=createUnoService("com.sun.star.frame.DispatchHelper")	
	dim args4(5) as new com.sun.star.beans.PropertyValue
	rem the parameters are from macro recorder (test the macro recorder only in single ODS file)
	args4(0).Name="Flags"
	args4(0).Value="A"
	args4(1).Name="FormulaCommand"
	args4(1).Value=0
	args4(2).Name="SkipEmptyCells"
	args4(2).Value=false
	args4(3).Name="Transpose"
	args4(3).Value=true
	args4(4).Name="AsLink"
	args4(4).Value=false
	args4(5).Name="MoveMode"
	args4(5).Value=4
	dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args4())
End Sub

Here is the link with some parameters: