dalla rete ho trovato questo codice che dovrebbe permettere di copiare in clipboard una tabella html per poi poterla incollare in un file excel, ma se eseguo lo script il browser mi da questo errore: Il componente ActiveX non può creare oggetto Excel.Application
Questo è il codice
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Documento senza titolo</title>
</
head>

<
body>
<
Script Language="VBScript">
<!--

   
Sub RunScript
        strCopy 
MyTable.InnerHTML
        document
.parentwindow.clipboardData.SetData "text"strCopy

        Set objExcel 
CreateObject("Excel.Application")
        
objExcel.Visible True
    
        Set objWorkbook 
objExcel.Workbooks.Add()
        
Set objWorksheet objWorkbook.Worksheets(1)
        
objWorksheet.Paste
    End Sub

//-->
</Script>
    <span id="MyTable">
        <table border="1" width="100%" id="table1">
    <tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
    </tr>
    <tr>
<td>Cell 4</td>
<td>Cell 5</td>
<td>Cell 6</td>
    </tr>
    <tr>
<td>Cell 7</td>
<td>Cell 8</td>
<td>Cell 9</td>
    </tr>
        </table>
    </span>
    

    <input id=runbutton type="button" value="Run Button" onClick="RunScript"> 
</body>

</html>