Micro Focus QTP (UFT) Forums
The test run cannot continue due to an unrecoverable error - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: The test run cannot continue due to an unrecoverable error (/Thread-The-test-run-cannot-continue-due-to-an-unrecoverable-error)



The test run cannot continue due to an unrecoverable error - neerndg123 - 10-18-2012

Hi,

I am getting the error mentioned in subject. No matter what is the first line of the code, it fails at that part only by giving this error. Following is the starting piece of code.
-----------------------
Code:
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible=true
-----------------------
Following is the code where I am getting error: Object required: 'God'
-----------------------
Code:
TheDate = Date( )
msgbox TheDate
GetDay = DatePart("d", TheDate)
GetMonth = DatePart("m", TheDate)
GetYear = DatePart("yyyy", TheDate)
MyDate = GetMonth & "/" & GetDay & "/" & GetYear
msgbox MyDate
With ExcelWS.UsedRange
    Set c = .Find (MyDate)
For each c in ExcelWS.UsedRange
If c = MyDate  then
                                                God = ExcelWS.UsedRange.Find(c)
                                                msgbox God
End If
            Set c = .FindNext(c)
Next
End With
FirstAddress= God.Address
SecondAddress =  God.Column
msgbox FirstAddress
msgbox SecondAddress

I am opening an excel application in which I want to write some results, which is later part. I am not able to do this. Please help!!!


RE: The test run cannot continue due to an unrecoverable error - Ankesh - 10-18-2012

if the value that you are looking for is not found, it will throw the error.

You can try the below code

Code:
intStartRange="A1"
intEndRange="A50"
intFoundRow=ExcelApp.Range(intStartRange,intEndRange).Find(<ValueBeingSearched>).Row

Please note this will always return the row number where the value was first found. To get the next occurance row, you need to set the range again.

Let me know if you need more help.

Regards,
Ankesh


RE: The test run cannot continue due to an unrecoverable error - neerndg123 - 10-18-2012

Hi Ankesh,

Thanks a lot for your reply. I will check and let you know whether it works or not.

Regards,
Neeraj

Hi,

By following, I am able to search the string I wanted to i.e. today's date in the excel sheet.

Code:
intNeer=ExcelWS.UsedRange.Find(MyDate)

It returns correct value. But I want to know the address of the Column+row where it is found. How to do that?

Regards,
Neeraj


RE: The test run cannot continue due to an unrecoverable error - ananthakumarbe - 09-17-2015

I'm getting a General run error while executing the following script:


Code:
Set objtab=description.create
Objtab(“MicClass”).value=”WebTable”
Set a=Browser("name:= ").Page("title:= ”).childobjects(objtab)
Msgbox a.count
For i=0 to a.count-1
B=a(i).tostring
Print b
next


Please help to resolve this.