Macros/Python Guide/Calc/Calc data ranges
< Macros | Python Guide | Calc
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
⇐ Return to Python Guide, Calc
Data Ranges
Defining ranges
NAME = 'test'
doc = XSCRIPTCONTEXT.getDocument()
sheet = doc.Sheets[0]
rango = sheet['A1:C10']
db_ranges = doc.DatabaseRanges
if not NAME in db_ranges:
db_ranges.addNewByName(NAME, rango.RangeAddress)