object required error
Hi all,
I am upgrading from 14 to 15 version recently. I am unable to get it this one, some times the code is executing successfully and sometimes getting Object required error, below one is the code
Dim TestReportFolder ,Test_reportexcel ,FinalTest_reportexcel
Function GetRecentExcel_InsertData
Set fso = CreateObject("Scripting.FileSystemObject")
Set recentExcel = Nothing
For Each file in fso.GetFolder(Test_Report_Path).Files
If (recentExcel is Nothing) Then
Set recentExcel = file
ElseIf (file.DateLastModified > recentExcel.DateLastModified) Then
Set recentExcel = file
End If
Next
If recentExcel is Nothing Then
log.Message( "No recent Test Report")
Else
Test_reportexcel = recentExcel.Name
log.Message(Test_reportexcel)
End If
aqUtils.Delay 1000
aqUtils.Delay 2000
Set app = Sys.OleObject("Excel.Application")
TestReportFolder = Test_Report_Path
FinalTest_reportexcel = TestReportFolder + "\" + Test_reportexcel
log.Message(FinalTest_reportexcel)
Set TestReportWorkBook =app.Workbooks.Open(FinalTest_reportexcel) --->at this line i am getting object required error