Macros/Basic/Calc/Data

From The Document Foundation Wiki
Jump to: navigation, search
Other languages:
English

Return to Index

Data

In this topic, many examples using current selection, caution, you sure the current select object is correct.

Read

Read like string for one cell (ScCellObj)

1 selection = ThisComponent.getCurrentSelection()
2 MsgBox selection.getString()

Read like value for one cell (ScCellObj)

1 selection = ThisComponent.getCurrentSelection()
2 MsgBox selection.getValue()

Write

Write string for one cell (ScCellObj)

1 selection = ThisComponent.getCurrentSelection()
2 selection.String = "Ingrid Bergman"

Write value for one cell (ScCellObj)

1 selection = ThisComponent.getCurrentSelection()
2 selection.Value = 100

Delete

Data series

Search and replace

Notes