procedure TForm1.Button2Click(Sender: TObject);variCount, jCount: Integer;XLApp: Variant;Sheet: Variant;beginbutton1.Enabled:=false;button2.Enabled:=false;if not VarIsEmpty(XLApp) thenbeginXLApp.DisplayAlerts := False;XLApp.Quit;VarClear(XLApp);end;tryXLApp := CreateOleObject('Excel.Application');exceptExit;end;XLApp.WorkBooks.Add; XLApp.WorkBooks[1].WorkSheets[1].Name := 'sheet1';Sheet := XLApp.Workbooks[1].WorkSheets['sheet1'];stringgrid1.Row := 0;xlapp.ActiveSheet.Columns[2].numberformat := '@';sheet.Columns[4].NumberFormatlocal := '@';for iCount := 0 to stringgrid1.RowCount - 1 dobeginfor jCount := 0 to stringgrid1.ColCount - 1 do Sheet.cells[iCount + 1, jCount + 1] := stringgrid1.Cells[jCount,iCount];stringgrid1.Row := iCount;application.ProcessMessages;end;XLApp.ActiveWorkbook.SaveAs(FileName:='1.xls');Screen.Cursor := crDefault;XLApp.quit;button1.Enabled:=true;button2.Enabled:=true;end;上面用xlapp.ActiveSheet.Columns[2].numberformat := '@';sheet.Columns[4].NumberFormatlocal := '@';写出来的都是一样。。。显示为64在过程中加了变量看了一下S;=sheet.Columns[4].NumberFormatlocal 的值,S就是64