ApiMateRadStudio.exe

链接:https://pan.baidu.com/s/1Sd-teDIRX9ZV48j6Jgc_wQ
提取码:7nk4

procedure TForm4.Button1Click(Sender: TObject);
var
  xls: TXlsFile;
begin
  xls := TXlsFile.Create(true);
  try
    CreateExcelFile(xls);

    //将文件保存为XLS
    if OpenDialog1.Execute then   //加一个 OpenDialog1
       xls.Save(OpenDialog1.FileName);
  finally
    xls.Free;
  end
end;

遇到错误:[dcc32 Error] Unit14.pas(518): E2003 Undeclared identifier: 'TDrawingFontCharSet'

将这六行注释掉

         //Major font
//  MajorLatin := TThemeTextFont.Create('Cambria', '', TPitchFamily.DEFAULT_PITCH__UNKNOWN_FONT_FAMILY, TDrawingFontCharSet.Default);
//  MajorEastAsian := TThemeTextFont.Create('', '', TPitchFamily.DEFAULT_PITCH__UNKNOWN_FONT_FAMILY, TDrawingFontCharSet.Default);
//  MajorComplexScript := TThemeTextFont.Create('', '', TPitchFamily.DEFAULT_PITCH__UNKNOWN_FONT_FAMILY, TDrawingFontCharSet.Default);
         //Minor font
//  MinorLatin := TThemeTextFont.Create('Calibri', '', TPitchFamily.DEFAULT_PITCH__UNKNOWN_FONT_FAMILY, TDrawingFontCharSet.Default);
//  MinorEastAsian := TThemeTextFont.Create('', '', TPitchFamily.DEFAULT_PITCH__UNKNOWN_FONT_FAMILY, TDrawingFontCharSet.Default);
//  MinorComplexScript := TThemeTextFont.Create('', '', TPitchFamily.DEFAULT_PITCH__UNKNOWN_FONT_FAMILY, TDrawingFontCharSet.Default);