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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of text output value in quicktest professional?

506


What is parameter in qtp?

676


What is the use of text output value in quicktest professional (qtp)?

595


Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?

1469


Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

1685






hi can any body give me a script for creating a modularity or keyword driven framework..i am working as a qtp tester for 2 months but still i am not exposed to framework in my company

1422


What is the purpose of loading qtp add-ins?

621


before launching qtp, we need to close all the open browsers u dont know what are all the browsers either it might be ie,mozilla etc and u dont know how many brosers are open.... u need to close all these before launching qtp.. can anyone plz temme d solution...

7220


How you can find length of array in qtp?

542


How to use the object spy in quicktest professional 8.0 version?

542


Where we use data driver in qtp?

605


can any one say that where we can download the QTP trail version ??????????

1358


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

1519


What are the Disadvantages of shared object repository?

568


hou can we use vb script in qtp could u tell me breafly

1734