Kumar,
You need to add the Microsoft Excel 8.0 Object library in your references. Your code then would look like this -
Dim xlsApplication As New Excel.Application
Dim xlsWorkBook As New Excel.Workbook
Dim xlsWorkSheet As New Excel.Worksheet
Set xlsWorkBook = xlsApplication.Workbooks.Add
Set xlsWorkSheet = xlsWorkBook.Worksheets.Add
' Include your code to populate this worksheet
xlsWorkSheet.PageSetup.PrintGridlines = True
xlsWorkSheet.Columns.AutoFit
xlsWorkSheet.PrintOut
' VB starts up Excel to do this printout, so we need to
' close this gracefully. If you want to save a copy of the
' worksheet you created, you might want to set the Saved
' and DisplayAlerts property set accordingly.
xlsWorkBook.Saved = False
xlsWorkBook.Close (False)
xlsApplication.DisplayAlerts = False
xlsApplication.Quit
Set xlsWorkSheet = Nothing
Set xlsWorkBook = Nothing
Set xlsApplication = Nothing
Hope this helps.
Thanks,
- Subha

Nothing is impossible, even the word impossible says I'm possible.