Adding worksheets

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
JonPedersen
Posts: 5
Joined: Sat Apr 02, 2011 2:10 pm

Adding worksheets

Post by JonPedersen »

Hi,
How do you add a worksheet and give it a name, and how do you know how many worksheets there are in the workbook?
best
Jon
KenWhite
Posts: 13
Joined: Mon Jan 03, 2005 8:23 pm
Contact:

Re: Adding worksheets

Post by KenWhite »

To add a new sheet

Code: Select all

  // XLS is an XLSReadWriteII5 component
  XLS.Add;
  // Name it
  XLS[XLS.Count - 1].Name := 'NewName';
To get the sheet count

Code: Select all

var
  NumSheets: Integer;
begin
  NumSheets := XLS.Count;
end;
Post Reply