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

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("")
   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?

OpenOffice 3.2.1, Windows XP/Vista
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 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, no OpenOffice, LibreOffice 6.4
User avatar
Posts: 27728
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 2 guests