uses 中添加 cxGridExportLink
var
SFD:TSaveDialog; FileName,FileExt:String;begin SFD:=TSaveDialog.Create(nil); SFD.Filter:='Excel文件 (*.xls)|*.xls'; SFD.Title:='导出为'; SFD.DefaultExt:='.XLS'; SFD.Options:=[ofOverwritePrompt, ofEnableSizing]; if not SFD.Execute then exit; //filename FileName:=SFD.FileName; FileExt:=UpperCase(ExtractFileExt(FileName)); if FileExt='.XLS' then begin ExportGridToExcel(FileName, cxGrid1, True, True); end else begin Application.MessageBox('不支持的导出格式', 'xx'); Exit; end; SFD.Free