Copy sheet from another ods file

Keyboard macros or custom scripts

Copy sheet from another ods file

Postby arrowman » Wed Feb 13, 2019 11:21 am

Hello,
I have a Basic script to copy one sheet to another sheet in the same file. I am doing it this way:
Code: Select all   Expand viewCollapse view
ThisComponent.Sheets.copyByName(sourceSheetName, nameOfNewSheet, 32767)


But for now I need to copy sheet from another file. I woudl like to do it something like:
Code: Select all   Expand viewCollapse view
sub testCopy
   Dim Dummy()
   oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   oDocPersonList = StarDesktop.loadComponentFromURL("file:///d:/test.ods", "_blank",0, Dummy() )
   document = ThisComponent
   
   'document.Sheets.copy(oDocPersonList.getSheets.getByIndex(0), "test", 32767)
end Sub


And of course "copy" method doesn't exits. How can achieve this?

Thanks,
A.
OpenOffice 3.2.1, Windows XP/Vista
arrowman
 
Posts: 8
Joined: Mon Nov 21, 2011 12:01 pm

Re: Copy sheet from another ods file

Postby Villeroy » Wed Feb 13, 2019 2:58 pm

Search "SheetLinkMode" in http://www.pitonyak.org/oo.php and in this forum.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26407
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 4 guests