OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

VB - Copy cells and Insert cells in other sheet

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Montse
Guest





PostPosted: Thu Apr 24, 2003 6:46 am    Post subject: VB - Copy cells and Insert cells in other sheet Reply with quote

Hi,
I 'm trying to copy a range of cells of a sheet and insert it in other sheet of other worksheet.
I don't find the way to do this simple, because I have done this very complicated and now I have the trouble that I don't paste the style of the cells.(Bold,..
Do you know any method?
I have find de method INSERTCELLS but non-empty cells cannot be moved off the sheet.

Thanks,

Montse[/b]
Back to top
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Thu Apr 24, 2003 1:39 pm    Post subject: Reply with quote

If the Dispatcher approach is suitable for you ... use the macro recorder to get the basic framework like:

Code:
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$C$16:$D$16"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Nr"
args3(0).Value = 2

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args3())
args1(0).Name = "ToPoint"
args1(0).Value = "$C$16:$D$16"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())

This copies and pastes values and format between sheets in a single document
Back to top
View user's profile Send private message
Montse
Guest





PostPosted: Fri Apr 25, 2003 7:19 am    Post subject: Reply with quote

Thanks, but I 'm developing with Visual Basic. I 'll search something like this.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group