07-27-2010, 12:02 PM
Hi,
I have done the modifications as per your reply. But not able to write in excel
However for writing in excel code is little bit different from yours code......
I am using the above code. Could ypu please tell me why is it not writting the header to excel.
Waiting for reply..........
Regads,
Anu
I have done the modifications as per your reply. But not able to write in excel
However for writing in excel code is little bit different from yours code......
Code:
'For Wirting in Excel Sheet’
Dim xlApp, xlBook, xlSheet ,sHeaderArray()
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.WorkBooks.Open("F:\Test.xls")
Set xlSheet = xlBook.WorkSheets("Sheet1")
'*** Writing Header***'
i = 0
For Each sHeader in sHeaderArray
i = i + 1
ExcelSheet.ActiveSheet.Cells(1, i).Value = sHeader
Next
' Save the sheet.
xlBook.Save
' Close Excel with the Quit method on the Application object.
xlApp.DisplayAlerts = False
xlApp.Quit
' Release the object variable.
Set ExcelSheet = Nothing
Set objExcel = Nothing
I am using the above code. Could ypu please tell me why is it not writting the header to excel.
Waiting for reply..........
Regads,
Anu