Open an Excel table by calling javascript in IE

Source: Internet
Author: User

<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<META http-equiv = Content-Type content = "text/html; charset = UTF-8">
<TITLE> open an Excel table </TITLE>

</HEAD>
<BODY>

<Input name = "shanghai" type = "button" class = "but" id = "shanghai" onClick = "StartExcel ('shanghai')" value = "shanghai store">

<Script language = "Javascript">
Var idTmr = "";

Function StartExcel (strFileName)
{
Var oExcel;
Var oWorkbook;
Var strAllName;
OExcel = new ActiveXObject ("Excel. Application");
// If (strFileName = null | strFileName = "")
// {Return;
//}
StrAllName = "\\\\ ep-hgh \ Top30 sales control table \ top30 -{strfilename}.xls";
OExcel. Workbooks. Open (strAllName );
// OExcel. Workbooks. Open ("file: // ep-hgh/Top30 sales control table/top30 -shanghai.xls");
OExcel. DisplayAlerts = false;
OExcel. Visible = true;
// OExcel. Quit ();
// OExcel = null;
// The key to preventing the death of EExcel !! Required !!! Severe downmoon statement
IdTmr = window. setInterval ("Cleanup ();", 1000 );
}

Function Cleanup (){
Window. clearInterval (idTmr );
CollectGarbage ();
}

</SCRIPT>

</BODY>
</HTML>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.