08-04-2008, 04:05 PM
Hi thanks, i found the solution.
Code:
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Workbooks.Add
Set NewSheet = ExcelObj.Sheets.Item(1)
NewSheet.Name = "CTO"
NewSheet.Cells(1,1).Value = "Sno"
NewSheet.Cells(1,2).Value = "C1"
NewSheet.Cells(1,3).Value = "O1"
ExcelObj.ActiveWorkbook.SaveAs "C:\CTO_TD.xls"
' close the application and clean the object
ExcelObj.Quit
Set ExcelObj = Nothing