I have been looking online to get the idea how to acess a range and then "clearing" it. Sadly even though i have found several solutions, vba in libre office makes things really complicated to understand. I have tried to record a macro, and edit it... It works but not as i want it to. I need to execute the below code from a Form (Dialog) and it does what its meant to, but shows everything in the background and I can't have that .... is there a way, to do this ? for example in vba Exel I would just write :
Range("A1:DA25000").ClearContents (or .Delete)
Here is what I got with macro recordings:
Function Brisanje()
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Nr"
args1(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$1:$DA$25000"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())
end Function