 | OO-Snippets: ScenarioCommons| Keywords | |
|---|
| Language | ooRexx |
|---|
| Application | Calc |
|---|
| Authors | Michael Hinz (initial)
|
|---|
| Supported Versions | 2.0.x |
|---|
| Supported OS | Win32 |
|---|
| Question | How can i add a scenario
|
|---|
| Answer | |
|---|
oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~XDesktop~XComponentLoader
url = "private:factory/scalc"
xCalcComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps)
xDocument = xCalcComponent~XSpreadSheetDocument
xSheet = xDocument~getSheets~XIndexAccess~getByIndex(0)~XSpreadSheet
xCellRange = xSheet~xCellRange~getCellRangeByName("B3:F6")
xCellRangeAddress = xCellRange~XCellRangeAddressable~getRangeAddress
CALL UNO.loadClass "com.sun.star.table.CellRangeAddress"
oAddr = bsf.createArray(.UNO~CellRangeAddress, 1)
oAddr[1] = xCellRangeAddress
aScenarioName = rexx
aScenarioComment = mein scenario
xScenSupplier = xSheet~XScenariosSupplier
xScenarios = xScenSupplier~getScenarios
xScenarios~addNewByName(aScenarioName, oAddr, aScenarioComment)
::requires UNO.CLS
|
|