06-14-2011, 01:18 PM
The error you are getting is because the object is not defined. please define the excel object first. Refer to below code :
Regards,
Parminder
Code:
Filename="<your path>"
Dim objExcel
Set objExcel = createobject("Excel.application")
objExcel.DisplayAlerts = False
Set oBook = objExcel.Workbooks.Open(Filename)
Set oSheet = objExcel.Activesheet
objExcel.Cells(1,1).Value = "Row"
oBook.SaveAs (Filename)
objExcel.Workbooks.Close()
Set oSheet=Nothing
Set oBook=Nothing
Set objExcel=Nothing
Regards,
Parminder