I use an external Data Sheet for the Test. I have many Test Iterations and have ensured that the Output data from the test is stored in the Data Sheet.

I am trying to save the sheet with a different name during the last iteration.
================================================== =======
If DataTable.GetCurrentRow = DataTable.GetRowCount OR DataTable.GetCurrentRow = Setting.Value("App.Test.Settings.Run.EndIteration" ) Then
DataTable.Export ("F:\QTP Testing\DataTable\" + Environment.Value ("TestName") + Environment.Value("TestIteration") + ".xls")
'This is the final data sheet with results of all the iterations.

Else DataTable.Export "F:\QTP Testing\DataTable\Imported.xls"
'This sheet is again imported at the beginning of the next Test Iteration.
End If
================================================== =====

I found out that "App.Test.Settings.Run.EndIteration" is incorrect and cannot be used. Is there any other way to access and compare with the "EndIteration" Variable in settings.

If there is no way to access that variable. Please let me know a feasible method.