title: export delphi stringgrid to excel
body: <p>I'm trying to export data from a stringgrid in delphi 7 to microsoft excel. I have been using this code to do it:</p>
  
  <pre><code>  objExcel := TExcelApplication.Create(nil);
    objExcel.Visible[LOCALE_USER_DEFAULT] := true;
    objWB := objExcel.workbooks.add(null,LOCALE_USER_DEFAULT);
    lineNumber := 1;
  
    for i:=1 to stringgrid1.rowcount-1 do begin
      for j:=0 to stringgrid1.ColCount-1 do begin
        objWB.Worksheets.Application.Cells.Item[i+lineNumber,j+1] := ''''+stringgrid1.Cells[j,i];
      end;
    end;
  </code></pre>
  
  <p>but when the data is big, it takes a very long time to finish. is there other faster way to export data from delphi 7 stringgrid to excel?</p>