Hi Prakash,
What you have written is correct, but MS excel application should be opened before you create
Set ExcelSheet = CreateObject("Excel.Sheet") object.
GeSHi (qtp):
Set ExcelObj=
CreateObject ("Excel.Application")Dim ExcelSheet
Set ExcelSheet =
CreateObject("Excel.Sheet")' Make Excel visible through the Application object.ExcelSheet.
Application.
Visible =
True' Place some text in the first cell of the sheet.ExcelSheet.
ActiveSheet.
Cells(1,
1).
Value =
"This is column A, row 1"' Save the sheet.ExcelSheet.
SaveAs "C:\Documents and Settings\Desktop\TEST.XLS"' Close Excel with the Quit method on the Application object.ExcelSheet.
Application.
Quit' Release the object variable.Set ExcelSheet =
NothingSet ExcelObj=
Nothing Created by GeSHI 1.0.7.20