E
E
Evgeny Ivanov2016-09-13 06:48:32
Delphi
Evgeny Ivanov, 2016-09-13 06:48:32

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

1 answer(s)
A
Andrew, 2016-09-13
@OLS

www.sql.ru/forum/172993/kak-programmno-dobavit-lis...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question