ba salam bacheha bebakhshid ke fingilishi shod
goftam ye seri code baraye bachehayi ke az bankaye etelaati sardar nemiyaran az jomle khodam bezaram ke betunan stringgrid ro dar excel zakhire konan omidvaram bedardetun bokhore

function RefToCell(ARow, ACol: Integer): string;
begin
Result := Chr(Ord('A') + ACol - 1) + IntToStr(ARow);
end;
function SaveSGToExcelFile(AGrid: TStringGrid; ASheetName, AFileName: string): Boolean;
const
Worksheet = -4167;
var
XLApp, Sheet, Data: OLEVariant;
i, j: Integer;
begin
Data := VarArrayCreate([1, AGrid.RowCount, 1, AGrid.ColCount], varVariant);
for i := 0 to AGrid.ColCount - 1 do
for j := 0 to AGrid.RowCount - 1 do
Data[j + 1, i + 1] := AGrid.Cells[i, j];
Result := False;
XLApp := CreateOleObject('Excel.Application');
try
XLApp.Visible := False;
XLApp.Workbooks.Add(WorkSheet);
Sheet := XLApp.Workbooks[1].WorkSheets[1];
Sheet.Name := ASheetName;
Sheet.Range[RefToCell(1, 1), RefToCell(AGrid.RowCount,
AGrid.ColCount)].Value := Data;
XLApp.Workbooks[1].SaveAs(AFileName);
Result := True;
finally
if not VarIsEmpty(XLApp) then
begin
XLApp.DisplayAlerts := False;
XLApp.Quit;
XLAPP := Unassigned;
Sheet := Unassigned;
end;
end;
end;

//example

procedure TForm1.Button1Click(Sender: TObject);
begin
if SaveSGToExcelFile(stringGrid1, 'My Stringgrid Data', 'c:\Excel.xls') then
ShowMessage('StringGrid saved!');
end;




faghat darmorede Function RefToCell ye tozihi bedam ke baraye taine Name Sotun ha dar excele A1,B1,...............