0

There are two javascript function .
the second method would call the first function passing two parameter.
in load_wood_excel function i am not able to access the parameter..
can any ony tel me how to pass interger , and also how to access the parameter in function????????

function load_wood_excel(row,column){
            alert(row);
            alert(column);

            var Excel;
            Excel = new ActiveXObject("Excel.Application");
            Excel.Visible = false;
            alert("pooran");
            return              Excel.Workbooks.Open("C:/Users/chandrpo/Desktop/othla/OPJ/ram.xls").ActiveSheet.Cells('row','column').Value;
            }

        function iterateExcel(){
        var row = 2;
        var column = 1;
        var someArray = new Array();
        do 
                {
                item = load_wood_excel();
                if(item !=null){
                var i = 0;
                someArray[0]= item;
                i++;
                row++;
                }
                item1 = load_wood_excel(2,1);
                }while (item != null || item1 != null);
        }

Edited by Dani: Formatting fixed

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Airshow
0

In iterateExcel() , you establish var row = 2; and var column = 1; but don't use either of them.

In the do/while loop, load_wood_excel() is called first without, then with arguments. Try calling the function once with load_wood_excel(row,column) instead of load_wood_excel(2,1) . Adjust the while clause accordingly.

In load_wood_excel(), ...ActiveSheet.Cells('row','column')... , are 'row' and 'column' supposed to be strings? ...ActiveSheet.Cells(row,column)... makes more sense.

Airshow

Edited by Airshow: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.