Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to Import data from a ".xls" file to Data table during
Runtime.

Answer Posted / masack

If you want import all the sheets of the workbook during
runtime datatable.

Dim array_shtname()

Set xls = createobject("Excel.Application")
xls.visible = true
Set xlsop = xls.workbooks.open ("excel\path")
shtcount = xlsop.worksheets.count

ReDim preserve array_shtname(shtcount)

For sh = 1 to shtcount
array_shtname(sh-1) = xlsop.worksheets(sh).name
Next
xls.quit

Data_Sheet_Count = datatable.GetSheetCount

For i = 1 to shtcount
Datatable.AddSheet Cstr(array_shtname(i -1))
datatable.ImportSheet "excel\path",i,cint(Data_Sheet_Count)
+i
Next

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to check bitmap output value?

1114


How many add-ins comes by default with quicktest professional?

890


What are the ways you can synchronize?

1000


I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You

1974


If object is not recognized by qtp but the object is standard object what is your approach?

958


Give me some real time point of way where exactly we can conduct audits?

1864


How do you capture tooltip using QTP?

1024


What are the various types of Actions in UFT?

999


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1866


Does QTP run in any environment?

1018


Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

1685


What test you perform mostly? Regression or retesting in your testing process?

972


How to customize checkpoints with parameters?

3496


What is quick test pro?

1003


Explain the Different types of QTP test assets and their extensions?

1048