summaryrefslogtreecommitdiff
path: root/scripting/examples/python/NamedRanges.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/examples/python/NamedRanges.py')
-rw-r--r--scripting/examples/python/NamedRanges.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripting/examples/python/NamedRanges.py b/scripting/examples/python/NamedRanges.py
index abdef141f397..812cabb583e0 100644
--- a/scripting/examples/python/NamedRanges.py
+++ b/scripting/examples/python/NamedRanges.py
@@ -35,3 +35,14 @@ def DefineNamedRange(sheet, x0, y0, width, height, name):
position.Row = 0
model.NamedRanges.addNewByName(name, content, position, 0)
return None
+
+def DeleteNamedRange(name):
+ try:
+ desktop = XSCRIPTCONTEXT.getDesktop()
+ model = desktop.getCurrentComponent()
+ model.NamedRanges.removeByName(name)
+ except Exception as e:
+ print("Caught Exception: " + str(e))
+ tb = e.__traceback__
+ traceback.print_tb(tb)
+ return None