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
What is the use of text output value in quicktest professional?
What is parameter in qtp?
What is the use of text output value in quicktest professional (qtp)?
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 ?
Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?
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
What is the purpose of loading qtp add-ins?
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...
How you can find length of array in qtp?
How to use the object spy in quicktest professional 8.0 version?
Where we use data driver in qtp?
can any one say that where we can download the QTP trail version ??????????
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?
What are the Disadvantages of shared object repository?
hou can we use vb script in qtp could u tell me breafly