Forum Discussion
meenakshiyadav1 wrote:
Test Unit-------
function Test()
{  
//Datasheet Path
ExcelPath = "D:\A360_AutoQA\TestData\Book1.xlsx";
Open_Excel(ExcelPath);
}
Excel Library code-------------
var ExcelPath;
function Open_Excel(){
var objExcel = new getActiveXObject("Excel.Application");
objExcel.Visible = true;
var objWorkbook = objExcel.Workbooks.Open(ExcelPath); ------(Getting error on this line)
}
Please guide me what am I doing wrong.
You are calling Open_Excel(ExcelPath) function with ExcelPath parameter but in your library code Open_Excel does not have parameter.
Put a breakpoint on the line var objWorkbook = objExcel.Workbooks.Open(ExcelPath); ------(Getting error on this line) and see the value for ExcelPath and share us.
function get_valid_row_count ()
{
var aobjWorkbook = objExcel.Workbooks.Open(ExcelPath);
It should be like this
var aobjWorkbook = objExcel.Workbooks.Open(ExcelPath.TestSheet);
- meenakshiyadav17 years agoContributor
Thanks Shankar, This seems to have solved my issue of opening the excel file.
- shankar_r7 years agoCommunity Hero
Glad it worked for you!
Related Content
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago