title: Create chart in OpenOffice Calc
body: <p>I am trying to create an OpenOffice Calc chart using the <code>OOoTools.pas</code> interface. The code is this:</p>
  
  <pre><code>/////////////////////////////// CODE //////////////////////////////////
  
  procedure TForm1.ProcessChart(aFilename : String);
  Var
                    oTheFile, oAllSheets, oMySheet, oCharts,
                    oCellRangeAddress, oRectangle, oSize : Variant;
  begin
   ConnectOpenOffice;
     oTheFile := OpenSheet(aFilename, True);
     oAllSheets:= oTheFile.Sheets;
  
     oMySheet:= oAllSheets.getByIndex(0);  // first sheet of the spreadsheet
  
     oCharts := oMySheet.getCharts;
  
     oCellRangeAddress := oTheFile.Bridge_getStruct('com.sun.star.table.CellRangeAddress');
     oCellRangeAddress.Sheet       := 0;// '1ere feuille du graphique
     oCellRangeAddress.StartColumn := 0;// 'Ligne 1
     oCellRangeAddress.StartRow    := 0;// 'Colonne A
     oCellRangeAddress.EndColumn   := 3;// 'Colonne D
     oCellRangeAddress.EndRow      := 29;// 'Ligne 30
  
     oRectangle := oTheFile.Bridge_GetStruct('com.sun.star.awt.Rectangle');
     oRectangle := oMySheet.Bridge_GetStruct('com.sun.star.awt.Rectangle');
     oRectangle.X      := 8000;
     oRectangle.Y      := 1000;
     oRectangle.Width  := 5000;
     oRectangle.Height := 5000;
  
     // Type Error Mismatch error on this call:       
     oCharts.addNewByName('LogData',
                          oRectangle,
                          oCellRangeAddress,
                          true,
                          true);
  
   DisconnectOpenOffice;
  End;
  
  /////////////////////////////// END CODE //////////////////////////////////
  </code></pre>
  
  <p>In the <code>oCharts.addNewByName</code> call I get a "Type Mismatch" error and have no further information what could be wrong.</p>
  
  <p>Or must I use another approach?</p>