如何使用vbscript以读/写模式打开qtp(.usr)文件

我能够打开使用VB脚本的QTP应用程序,但是当我尝试打开文件,它是在只读模式下打开,当我运行脚本,它不会从Excel表中读取数据,它应该已经读取。

Set oShell = CreateObject ("WScript.Shell") Dim qtpAppObj,qtpTest 'Create the QTP Application object Set qtpAppObj = CreateObject("QuickTest.Application") 'Open the test in read-only mode qtpAppObj.Open c:\test, True 'set run settings for the test Set qtpTest = qtpAppObj.Test 

我正在使用上面的代码

所以我想读一个excel文件,我认为它不能被读取,因为只读模式。

这是True是用只读模式打开testing。

 qtpAppObj.Open c:\test, True 

将其更改为false并运行

 qtpAppObj.Open c:\test, false 

你可以请显示正在读取excel文件的代码。 我想你可能从Datatable读取数据。 所以这就是为什么它是从testing内读取,但不能用QTP AOM读取。

请显示excel阅读代码。