[Solved] How to get the active sheets index?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
cleanman2
Posts: 36
Joined: Tue Jan 25, 2011 6:21 pm

[Solved] How to get the active sheets index?

Post by cleanman2 »

I am using Python.

Code: Select all

doc = XSCRIPTCONTEXT.getDocument()
oSheets = doc.getSheets()
sSheet = doc.getCurrentController().getActiveSheet()
name = sSheet.Name
Will get me the name of the active sheet. How do I get it's index?

Thanks, Jim
Last edited by Hagar Delest on Sat Sep 14, 2013 4:43 pm, edited 1 time in total.
Reason: tagged [Solved].
User avatar
Charlie Young
Volunteer
Posts: 1559
Joined: Fri May 14, 2010 1:07 am

Re: How to get the active sheets index?

Post by Charlie Young »

Code: Select all

sSheet.RangeAddress.Sheet
Apache OpenOffice 4.1.1
Windows XP
cleanman2
Posts: 36
Joined: Tue Jan 25, 2011 6:21 pm

Re: How to get the active sheets index?

Post by cleanman2 »

Thank you, that worked. Knew it was something simple, just couldn't come up with it.

Regares, JIm
OpenOffice 3.2 on Ubuntu
Post Reply