My test cases automated with ALM with BPT and QTP 11.

The test data was mapped to test resource folder in the form of excel ( Dynamic data in BPT)

when run bunch of testcases from test lab manually means select testcases and clik run that moment, while execution it is
taking dynamic data as expected and excution working fine

when run the same test cases through OTA code, while execution it is taking static data instead of dynamic data, but execution working fine.

pl provide solution.

I am using the below code>
set tdc = createobject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "http://qcURL/qcbin/"
tdc.login "yourUserName","yourPassword"
tdc.Connect "yourDomain","yourProject"

Set objShell = CreateObject("WScript.Shell")
Set TSetFact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tsFolder = tsTreeMgr.NodeByPath("Root\Formal Tests\YourTestDirectory")
Set tsList = tsFolder.FindTestSets("Your TestSet name. This is case sensitive!")

Set theTestSet = tsList.Item(1)
Set Scheduler = theTestSet.StartExecution("")
Scheduler.RunAllLocally = True