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 get data from excel sheet to the script? write the
script.

Answers were Sorted based on User's Feedback



How to get data from excel sheet to the script? write the script...

Answer / jyothi

Set a= Createobject("Excel.Application
Set b = a.workbooks.open"D:\Keyword\Test Data\data.xls"
Set c = b.Worksheets("sheet name")


Then retrieve the data like

set x= c.cells(1,1).value

Is This Answer Correct ?    8 Yes 2 No

How to get data from excel sheet to the script? write the script...

Answer / cheryl

datatable.import("xlsheetname.xls")

Is This Answer Correct ?    10 Yes 6 No

How to get data from excel sheet to the script? write the script...

Answer / he he eheyyy he ... baa

Excel.Workbook workBook = app.Workbooks.Open(Path, 0,
true,
5,
"",
"",
true,
Excel.XlPlatform.xlWindows,
"\t",
false,
false,
0,
true,
1,
0);

//// Get The Active Worksheet Using Sheet Name Or
Active Sheet
Excel.Worksheet workSheet =
(Excel.Worksheet)workBook.ActiveSheet;

try
{
string[] email = new string[40];
for (int i = 1; i < email.Length; i++)
{
if (i <= 40 )
{
if
(((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2
!= null)
{
rowIndex = 2 + index;
string emailid =
((Excel.Range)workSheet.Cells[rowIndex,
colIndex1]).Value2.ToString();
//string[] email = new string[9];

//string lastName =
((Excel.Range)workSheet.Cells[rowIndex,colIndex2]).Value2.ToString();
//string emailid =
((Excel.Range)workSheet.Cells[rowIndex,
colIndex3]).Value2.ToString();
Class1.SendMail(emailid);

//Response.Write(emailid);




index++;

}
}
}

}
catch (Exception ex)
{
app.Quit();
Response.Write(ex.Message);
}
}

Is This Answer Correct ?    1 Yes 1 No

How to get data from excel sheet to the script? write the script...

Answer / srinath

close the excel sheet which you want to open in QTP
first row will always be column name which will be used in
script

datatable.import("c:\path,,,\xlsheetname.xls")
a=datatable.value("jksdfj")

Is This Answer Correct ?    3 Yes 4 No

How to get data from excel sheet to the script? write the script...

Answer / rao' prasad

DataTable.Import("xlsheetname.xls")
For i=1 to DataTable.GetRowCount step 1
DataTable.SetCurrentRow(i)
........................................
.......................................
Stmts
......................................
...................................
DataTable.SetNextRow
Next

Is This Answer Correct ?    4 Yes 5 No

How to get data from excel sheet to the script? write the script...

Answer / murali k m

datatable.Importsheet "D:\Keyword\Test Data\data.xls"

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More QTP Interview Questions

Why do we go for Qtp? What are the advantages of qtp? Diff between winrunner and Qtp?

3 Answers   Symphony,


what is objectidentification?

2 Answers  


how can u put synchronization point in qtp,wat is exactly synchroniztion why we use it wat is benifit in qtp

13 Answers   College School Exams Tests, Mind Tree,


If we write a script in the expert view how are the objects created in the object repository? to be clear i will explain my problem first i have recorded the mercurytours application by providing the link www.mercurytours.com and all the objects are stored in the object repository ok this is fine. but i have copied the script generated in the above processes and pasted in a new test and tried to run that script but as the objects were not stored in the object repository it showed an error (The "Welcome: Mercury Tours" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object).so how can i overcome that error

6 Answers  


How to "Turn Off" QTP results after running a Script?

3 Answers   Crea,


if the excel sheet specified in script is not there,we get run time error how to handle the error ,please anybody explain me in detail

2 Answers   Quinnox,


what is the diff between Procedure and function

3 Answers   iFlex,


When The Low Level Recording is Used in QTP

17 Answers  


Tell some commonly used Excel VBA functions?

0 Answers  


in one page we have 100 links i have to click the 99th link how can i click the 99th link.

4 Answers   GK Technologies, IBM,


What is meant by Environmental variables?2 types r there know…can u pls explain clearly?

1 Answers  


Does quicktest professional is unicode compatible?

0 Answers  


Categories