dati.ods <http://nabble.documentfoundation.org/file/n4179030/dati.ods>
Hy, i'm a new users and i ask for help to register in a calc sheet, a macro
that inserts the values of two or more cells in a pie chart. I used the
function " records macro" of Libre Office 5.0 and although the recording of
the macro has selected the chart type (pie), the execution of the macro
gives me a column chart.
Enclose Example and the macro named "B"
Thank you all
sub B
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$B$2"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "By"
args2(0).Value = 1
dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, args2())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertObjectChart", "", 0,
Array())
end sub