[Solved] Insert a new sheet at a certain position

Creating a macro - Writing a Script - Using the API

[Solved] Insert a new sheet at a certain position

Postby MINTHETNAUNG » Mon Jun 25, 2018 6:35 am

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
Posts: 18
Joined: Mon Jun 18, 2018 3:33 am

Re: Inset a new sheet at a certain position

Postby Zizi64 » Mon Jun 25, 2018 7:39 am

See the
Code: Select all   Expand viewCollapse view
insertNewByName(name, index)

function in Andrew Pitonyak's free macro book (version 4):

(It creates a new spreadsheet and insert it at the specified location with the supplied name.)
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.0; AOO4.1.6
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.
User avatar
Posts: 8771
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests