Micro Focus QTP (UFT) Forums
Changing the datatable path using AOM - 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: Changing the datatable path using AOM (/Thread-Changing-the-datatable-path-using-AOM)



Changing the datatable path using AOM - rajarajangk - 08-25-2010

Hi,

I am trying to change the datatable path of my QTP scripts by using excel macro code as follows,

Code:
Set App = CreateObject("QuickTest.Application")
App.Open "C:\Documents and Settings\Desktop\sample1"'opening my QTP script
Set qtTestResources = App.test.Settings.Resources'creating a object to access resource tab(file->setting->resources tab)
New_Loc = "C:\Documents and Settings\Desktop\inputdata.xls"
qtTestResources.DataTablePath = "C:\Documents and Settings\Desktop\inputdata.xls"

When it invokes the last line, QTP will be closed automatically.

Please let me know is it possible to change the datatable sheetname in QTP scripts through the object "QuickTest.Application" if so please guide me how to do the same.

Note: As I need to change the datatable inputsheet name for N number of QTP scripts so I thought of automating this work through excel macro instead of opening every scripts manually and change its inputsheet path