这个问题应该到asp板块去。。这个板块是JavaScript的,跟JScript严重不一样..

解决方案 »

  1.   

    1 没有权限
    或者
    2 没有excel这个需要浏览器支持和安全性降低
      

  2.   

    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40"><head>
    <meta http-equiv=Content-Type content="text/html; charset=shift-jis">
    <script>
    function out(){ try{
    var elTable = document.getElementById("out");
    var oRangeRef = document.body.createTextRange();
    oRangeRef.moveToElementText( elTable );
    oRangeRef.execCommand( "Copy" ); var oXL = new ActiveXObject("Excel.Application")
    var oWB = oXL.Workbooks.Add ;
    var oSheet = oWB.ActiveSheet ;
    oSheet.Paste();
    oSheet.Cells.NumberFormatLocal = "@";

    oSheet.Columns("D:D").Select
    oXL.Selection.ColumnWidth = 20 //oSheet.Columns("A:A").Select
    //oSheet.Columns("A").Width = 1000;

    oSheet.Hyperlinks.Add(oSheet.Range("F14"), "http://www.sina.com.cn", "", "", "sina") oXL.Visible = true;
    oSheet = null;
    oWB = null;
    appExcel = null; }catch(e){alert(e.description)}

    }</script>
    </head><body><table id ='out'>
     <tr>
      <td x:str bgcolor="#FF0000">00001</td>
      <td x:str>0002</td>
     </tr>
     <tr>
      <td height=18 align=right style='height:13.5pt' x:str>00001</td>
      <td align=right x:str>000002</td>
     </tr>
     <tr>
      <td x:str>中文</td>
      <td x:str>にほんご日本語</td>
     </tr>
    </table>
    <INPUT type="button" value="Button" id=button1 name=button1 onclick="out()">
    </body>
    </html>