Delphi6 OleApplication Excel How to add new worksheets to active workbook.
Posted on 2004-04-05
Have a need to have seven initial worksheets in a workbook, but how do you add another 4 to the three as default? Both the 'add on opening' workbook and the 'add on fly' to an open workbook methods are required please. Code so far...
procedure ExcelOpen(Sender: TObject; Excelname:String);
// If the workbook exists, open it, else create an instance of it.
OleApplication := CreateOleObject('Excel.Application');
if fileexists(dataq.outdir+'\'+Excelname) then
end else begin
// what is the code that should generate the total 7 worksheets?