Board index » delphi » Deleting a Excel Page in a spreadsheet

Deleting a Excel Page in a spreadsheet

I'm tring to delete one page within a spread sheet.

Can anyone help me please ?

Thanks,

Ed
d6E, Excel2000

 

Re:Deleting a Excel Page in a spreadsheet


<<Ed:
I'm tring to delete one page within a spread sheet.

Quote

var
  WS: _Worksheet;
..
  WS := (Excel.Workbooks[1].Worksheets[2] as _Worksheet);
  WS.Delete(lcid);

--
Deborah Pate (TeamB) http://delphi-jedi.org

  TeamB don't see posts sent via Google or ISPs
  Use the real Borland server: newsgroups.borland.com
  http://www.borland.com/newsgroups/genl_faqs.html

Re:Deleting a Excel Page in a spreadsheet


Quote
> var
>   WS: _Worksheet;
> ..
>   WS := (Excel.Workbooks[1].Worksheets[2] as _Worksheet);
>   WS.Delete(lcid);

WS := (Excel.Workbooks[1].Worksheets[TheSheetName] as _Worksheet);
WS.Delete(lcid);

Can you delete via WorkSheet Name instead of worksheet number ?

Thanks Again,

Ed

Other Threads