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
How to check bitmap output value?
How many add-ins comes by default with quicktest professional?
What are the ways you can synchronize?
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
If object is not recognized by qtp but the object is standard object what is your approach?
Give me some real time point of way where exactly we can conduct audits?
How do you capture tooltip using QTP?
What are the various types of Actions in UFT?
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?
Does QTP run in any environment?
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?
What test you perform mostly? Regression or retesting in your testing process?
How to customize checkpoints with parameters?
What is quick test pro?
Explain the Different types of QTP test assets and their extensions?