Once again I'm posting a question for a very simple matter, but again, I've been searching for this for hours, in the forum, in google, in pitonyak etc.
I could not find a way to copy a cell(containing a formula) and paste it into multiple cells(ranges).
So I decided using macro recorder. But now, it pops up overwriting prompt. Normally this is something I prefer to keep. I know that I can disable/enable it from the tools>options...
But I want to disable this pop up while macro commands are working.
I've found some codes to disable some warning messageges, but I could not find one to disable overwrite a cell warning.
Could anyone please kindly honor me some guidance?
Code: Select all
sub fromheretothere
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 = "ToPoint"
args1(0).Value = "from"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = "to"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub