Try This:
Sub Macro1()
Dim xlSummary As Workbook
Dim wkbSummary As Worksheet
Set xlSummary = ActiveWorkbook
Set wkbSummary = xlSummary.Worksheets(1)
wkbSummary.Delete
End Sub
Quote:
>-----Original Message-----
>Can anyone tell me why the following VB6 code does not
delete the first
>sheet in the workbook?
>It should do.
>Dim xlSummary as New Excel.Application
>Dim wkbSummary as Excel.Workbook
>Set xlSummary = New Excel.Application
>xlSummary.Workbooks.Open filename.xls
>Set wkbSummary = xlSummary.ActiveWorkbook
>wkbSummary.Worksheets(1).Delete
>I am running VB6 and MS Offixe XP under WinXP Pro,
>and yes the project does reference the MS Excel 10.0
Object Library
>.