Ask Your Question
0

How do I activate a sheet in OO Basic

asked 2018-08-19 17:33:04 +0200

Orpheus2000 gravatar image

What's the secret to activating a particular sheet, please?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2018-08-19 18:20:35 +0200

Ratslinger gravatar image

updated 2018-08-19 18:37:07 +0200

Hello Orpheus2000,

Going strictly on the question:

oSheet = ThisComponent.Sheets.getByName("Sheet_Name_To_Activate")
ThisComponent.CurrentController.setActiveSheet(oSheet)

will activate a particular existing sheet.

If you just wish to access a sheet:

oSheet = ThisComponent.Sheets.getByName("Sheet_To_Access")

or

oSheet=ThisComponent.CurrentController.ActiveSheet

Once you have the sheet you can get at specific info:

oCell = oSheet.GetCellRangeByName("A1")
oCell.setString("Hello")

For much more info on macros in Calc, here is the PDF for Open Office Macros Explained by Andrew Pitonyak -> OOME

It is the best single source for LO/AOO macros.

edit flag offensive delete link more

Comments

Thanks for that, and I now have Andrew Pitonyak’s PDF, which looks to be exactly what I needed.

Orpheus2000 gravatar imageOrpheus2000 ( 2018-08-21 13:12:29 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-08-19 17:33:04 +0200

Seen: 382 times

Last updated: Aug 19 '18