[Solved] Insert a new sheet at a certain position

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
MINTHETNAUNG
Posts: 18
Joined: Mon Jun 18, 2018 3:33 am

[Solved] Insert a new sheet at a certain position

Post by MINTHETNAUNG »

Hi there, I have been looking into this topic in this forum but I could not find a solid solution that would meet the requirement. Let's say I have two sheets in Calc document: Product and Table. Then I want to insert a new sheet next to the Product sheet but not like inserting a new sheet at the end of all sheets (the solutions I found so far insert at the end of all sheets. I don't want it.). So, how could I insert a new sheet at a certain position with Calc Macro?
Last edited by MINTHETNAUNG on Mon Jul 09, 2018 9:04 am, edited 1 time in total.
Openoffice 4.1.5 on Windows 10
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Inset a new sheet at a certain position

Post by Zizi64 »

See the

Code: Select all

insertNewByName(name, index)
function in Andrew Pitonyak's free macro book (version 4):
http://www.pitonyak.org/OOME_4_0.odt

(It creates a new spreadsheet and insert it at the specified location with the supplied name.)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply