Pasting contents not working in AOO 4.1.12

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Pasting contents not working in AOO 4.1.12

Post by kingfisher »

Hello. I updated from 4.1.9 when this macro (probably recorded from paste special) worked completely. It still works in an .ods document but no longer works when I try to use it to paste in a .csv document. Another macro, which converts formulas to values, also only now works for .ods documents. Can anyone tell me why and what I need to change?

Code: Select all

Sub PasteContents
'Paste contents without notes and formatting
aPaste(0).name = "Flags"
aPaste(0).Value = "SVDF"
aPaste(1).name = "FormulaCommand"
aPaste(1).Value = 0
aPaste(2).name = "SkipEmptyCells"
aPaste(2).Value = false
aPaste(3).name = "Transpose"
aPaste(3).Value = false
aPaste(4).name = "AsLink"
aPaste(4).Value = false
aPaste(5).name = "MoveMode"
aPaste(5).Value = 4
oDoc = ThisComponent
vDispatcher = createUnoService( "com.sun.star.frame.DispatchHelper" )
vFrame = ThisComponent.CurrentController().getFrame
vDispatcher.executeDispatch( vFrame, ".uno:InsertContents", "", 0, aPaste() )
oDummy = oDoc.createInstance( "com.sun.star.sheet.SheetCellRanges" )
oDoc.CurrentController.Select( oDummy )
Apache OpenOffice 4.1.9 on Linux
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Pasting contents not working in AOO 4.1.12

Post by JeJe »

Have you tried recording the macro again - then you can compare the two?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: Pasting contents not working in AOO 4.1.12

Post by kingfisher »

Thanks for replying. On further reflection, it may not have been recorded. I have, however, recorded a macro while special pasting from one .csv file to another and that macro fails to work. It seems there has been some code change in AOO which prevents pasting to a .csv file by macro. My macros are attached to icons on the toolbar so they provide a one click operation instead of the multiple clicks required to special paste each time.
Apache OpenOffice 4.1.9 on Linux
Post Reply