OpenOffice Calc macro: Modifying Chart RangeAddress

dim graphSheet, graph, graphs As Object 
dim range As New com.sun.star.table.CellRangeAddress 

graphSheet = doc.getSheets().getByName("Graph") 
graphs = graphSheet.Charts 
'graph = graphs.getByIndex(0).EmbeddedObject 
' don't use getEmbeddedObject !! 
   oGraf = oGrafs.getByName("The_Name_Of_Graph") 
   ' define a extension 
   mRange(0).EndRow = 3 
   ' altera a extension atual 
   oGraf.setRanges ( mRange ( ) )
    
With range 
   .Sheet = 1 
   .StartColumn = 0 
   .StartRow = 0 
   .EndColumn = numMonths + 1 
   .EndRow = which + 1    
End With 
    
graph.Range = range

Reference:

Modifying Chart RangeAddress




Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>