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
What is the difference between shared and local object repository?
What are the types of object repositories? Which one is you are using?
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.
how to know no.of mails in our g mail by using vb-script
Explain how you can delete excel file in qtp?
What is file database?
distinguish between old version and new version QTP features.
In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.
what type of framework u r using in ur organization
What is action? How many types of actions are there in qtp?
How do I lauch my test website using code from qtp in different environmet, uat and PPTE?
how did u use automating testing tools in ur job?
What are the different attribute used with regular expression?
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?
What is synchronization point in QTP?