The following code can run normally only when the security level of IE is low. It is posted for reference by friends who can learn this technology.
The Code is as follows:
Script
Function readThis (){
Var tempStr = "";
Var filePath = document. all. upfile. value;
Var oXL = new ActiveXObject ("Excel. application ");
Var oWB = oXL. Workbooks. open (filePath );
OWB. worksheets (1). select ();
Var oSheet = oWB. ActiveSheet;
Try {
For (var I = 2; I <46; I ++ ){
If (oSheet. Cells (I, 2). value = "null" | oSheet. Cells (I, 3). value = "null ")
Break;
Var a = oSheet. Cells (I, 2). value. toString () = "undefined "? "": OSheet. Cells (I, 2). value;
TempStr + = ("" + oSheet. Cells (I, 2). value +
"" + OSheet. Cells (I, 3). value +
"" + OSheet. Cells (I, 4). value +
"" + OSheet. Cells (I, 5). value +
"" + OSheet. Cells (I, 6). value + "\ n ");
}
} Catch (e ){
// Alert (e );
Document.all.txt Area. value = tempStr;
}
Document.all.txt Area. value = tempStr;
OXL. Quit ();
CollectGarbage ();
}
Script
The above code can run normally only when the security level of IE is set to a low level. The main reason is that you can learn this technology.