Answer the question
In order to leave comments, you need to log in
How to create a sheet in Excel?
How to create a new sheet in Excel using Delphi 7?
This code creates an excel file (with 3 sheets by default). More sheets need to be added.
Sheet names are default. Just add.
//Создание нового excel файла.
//Входные параметры - полный путь к файлу (с именем и расширением), кол-во листов.
// Путь к Excel файлу full_path_to_file:='c\test.xls';
procedure create_excel_file(full_path_to_file: string; list_number:integer);
var
Excel: Variant;
i:integer;
begin
Excel := CreateOleObject('Excel.Application');
Excel.Visible := False;
Excel.DisplayAlerts:=False;
Excel.WorkBooks.Add;
//Создаем листы
//list_number - количество добавляемых листов
Excel.Save(full_path_to_file);
Excel.Quit;
end;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question