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 you mean by artifact,milestone...
How to test the login page in different ways in automation testing and i need code?
wht type of User defined functions or Java Releated functions Do we write in VB scripting
Call to copy of an action and call to existing action… i know the diff but in real project how to use..? i want live scenario.pls help me..
Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points
How to use reporter.report event in qtp ?
What is ‘object spy’ and what is the function of object spy in qtp?
hi guys, pls tell me for testing institution training hub, hitech city is best or not?
Explain about the test fusion report of quicktest professional?
When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.
What is the process of synchronizing qtp and aut?
your coming from electrical backgroung..but y ur coming to software side?
How qtp identifies objects?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com
How to handle the exceptions using the recovery scenario manager in qtp?