Dim qtApp 'As QuickTest.Application ' Declare the Application object variable Dim qtTest 'As QuickTest.Test ' Declare a Test object variable Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable Dim scriptPath Dim ResultPath scriptPath = "C:\Users\photo\Desktop\Study\Test_try" ResultPath = "C:\Users\photo\Desktop\Study\TestResult" ' Create the Application object Set qtApp = CreateObject("QuickTest.Application") ' Start QuickTest qtApp.Launch ' Make the QuickTest application visible qtApp.Visible = True ' Set QuickTest run options qtApp.Options.Run.CaptureForTestResults = "OnError" qtApp.Options.Run.RunMode = "Normal" qtApp.Options.Run.ViewResults = False ' Open the test in read-only mode qtApp.Open scriptPath, True ' set run settings for the test Set qtTest = qtApp.Test qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object qtResultsOpt.ResultsLocation = ResultPath ' Set the results location qtTest.Run qtResultsOpt ' Run the test MsgBox qtTest.LastRunResults.Status ' Check the results of the test run qtTest.Close ' Close the test Set qtResultsOpt = Nothing ' Release the Run Results Options object Set qtTest = Nothing ' Release the Test object Set qtApp = Nothing ' Release the Application object