Hello , I m a newbie using macro AOO. I m having trouble to find the solution of my script . I just wanna paste data from a cell in another sheet using the "pastecellRange".Help me to solve and fix my script please.....many tks
sub copas
dim copy as object
dim doc as object
dim tim as object
dim paste as object
dim osheet as object
dim t as boolean
dim u as boolean
dim v as boolean
t= False
u= false
v= false
doc=thiscomponent
osheet=doc.sheets.getbyname ("Sheet2")
copy=osheet.getcellrangebyname ("a1:b1")
tim=thiscomponent.currentcontroller
paste=doc.sheets.getbyname ("Sheet1").getcellrangebyname ("a3:b3")
tim.PasteCellRange(paste,com.sun.star.sheet.PasteOperation.ADD,copy,t,u,v,com.sun.star.sheet.CellInsertMode.DOWN)
end sub
Last edited by Hagar Delest on Sat Nov 01, 2014 5:13 pm, edited 1 time in total.
Reason:tagged solved
Debian 8 Jessie
Linux Mint 17.3 XFCE
Country : Indonesia
Learning is a need
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Tks FJCC for your fast response..Sorry if my english is bad.. I know the use of the "CopyRange". But I want something else. Since I look the PasteCellRange, I wonder if this code can work either.
I want the data can be pasted in other cell and make the existing data (example : the data in sheet1.a3:b3) will move down (like Insert down cell)after the new data has been pasted ,but not make the existing cell in the right side (example:sheet1.c3:g3) is moving down either.
I m curious of what is the functions of the "PasteCellRange"
Debian 8 Jessie
Linux Mint 17.3 XFCE
Country : Indonesia
Learning is a need
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Thanks again for your help FJCC..
Yeah it does work very nice......Well, I ll use your script to finished my project.
For Kingfisher > Any script for the alternative using "SetDataArray" & "GetDataArray" would be appreciate??
Because I just wanna know what is the best code and easy to understand for me. In fact , I don't know how to write script in BASIC (AOO) til now. I only read in the forum and google search to know the usage of any script that I need to make my project . Of course, I know how to placed the code and put the macro into the buttons. So I Seek for the best and most suitable code then I try and error to have the results.
I heard about MRI tools, but I don't know how to use it?Where should I learned from?Especially for the beginner like me? I know that this is not the right post to ask it...But any link would be very helpful ???
Debian 8 Jessie
Linux Mint 17.3 XFCE
Country : Indonesia
Learning is a need
The following thread would be a good place to start for Basic. If you download Andrew Pitonyak's macro document I suggest you download the pdf version. Thread : Basic Documentation.