All I need is a way for a Calc macro to change the sheet that is being shown in the workbook. I've got the name of the page that I want to jump to, but I can't find a function that will do the jump. This is the closest I can get...
sub goToPageByName
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim sheets as object
dim RollsSheet as object
dim JumpToSheet as object
dim SheetNameCell as object
dim TestCell as object
dim SheetName as String
rem ----------------------------------------------------------------------
rem get access to the document
document = thisComponent 'the current document should be of type Calc
sheets = document.getSheets()
RollsSheet = sheets.getByName("Rolls")
SheetNameCell = RollsSheet.getCellByPosition(5,1)
SheetName = SheetNameCell.String
JumpToSheet = sheets.getByName(SheetName)
rem this just to prove I've got the right value
TestCell = RollsSheet.getCellByPosition(6,1)
TestCell.String = SheetName
JumpToSheet.IsVisible = True
end sub