Ask Your Question

Calc: How do you bring a particular sheet to the front

asked 2018-08-22 12:47:05 +0200

Orpheus2000 gravatar image

Is there a property that will place a particular sheet in a multi-sheet workbook at the front, without having to move it or to make all other sheets invisible?

edit retag flag offensive close merge delete


This is a duplicate question - see How do I activate a sheet in OO Basic

Ratslinger gravatar imageRatslinger ( 2018-08-22 15:38:20 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-08-22 12:56:41 +0200

Lupp gravatar image

updated 2018-08-22 14:08:43 +0200

Why isn't clicking on the sheet's tab good enough for you?

You can also select a sheet from the navigator pane or by entering (and confirming) its name in the 'Name Box' left in the formula bar.


Since the questioner seemingly wanted to bring a sheet to front (make it the ActiveSheet) by user code, I give a solution in Basic:

nextSheetToMakeActive = ThisComponent.Sheets.GetByName("MiracleSheet") 
REM Use correct name.
REM Or, if the index of the sheet is known (and stable enough) simply: 
REM nextSheetToMakeActive = ThisComponent.Sheets(theIndex) 
edit flag offensive delete link more


I wanted to automate my project as much as possible, including presenting the User with the appropriate sheet at the appropriate time, as I had been doing in Excel. I appreciate that LibreCalc does not have all of the functionality of Excel, but without asking questions like this I cannot pin down the limitations. There seems to be no useful and comprehensive reference to properties and methods, so I am starting to write my own by finding out the hard way.

Orpheus2000 gravatar imageOrpheus2000 ( 2018-08-22 13:26:06 +0200 )edit

Did you mean you wanted to bring a sheet to front by user code ("macro")?
If so you should surely make this explicit in your question and add a suitable tag.

Lupp gravatar imageLupp ( 2018-08-22 14:02:09 +0200 )edit

Quoting @Orpheus2000: "I cannot pin down the limitations. There seems to be no useful and comprehensive reference to properties and methods,"
There's a difficulty in fact. Developer information may assume too much previous knowledge.
A good starting point, however, still is OOME by Andrew Pitonyak.The link points to the .pdf version. There also is the .odt version and everything available from here.

Lupp gravatar imageLupp ( 2018-08-22 14:15:48 +0200 )edit

As I just found you commented doubtfully on a similar recommendation in another thread:
You can be sure that I didn't hide secret knowledge. Next to everything I now can do in custom programming for LibO I learned primarily from the linked texts. Only when prepared this way I could start using and the like with some hope to get useful results.
BTW: What reference did you use when working with Excal-VBA?

Lupp gravatar imageLupp ( 2018-08-22 14:45:31 +0200 )edit

I found the answer in the use of Dispatcher

Orpheus2000 gravatar imageOrpheus2000 ( 2018-08-22 17:28:59 +0200 )edit

That's not the best idea, probably. Wanting to "automate" documents you will anyway have to learn how to use the API. The "slot machine" the dispatcher is, only knows about 5000 commands concerning the complete range of document types and contained objects.

Lupp gravatar imageLupp ( 2018-08-22 22:12:47 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-08-22 12:47:05 +0200

Seen: 39 times

Last updated: Aug 22 '18