看看下面的例子<HTML>
<BODY><INPUT id=button1 name=button1 type=button value=点击测试><SCRIPT LANGUAGE="VBScript">       sub button1_onclick()
          dim app
          set app = createobject("Excel.Application")
    
          app.Visible = true
    
          dim wb
          set wb = app.workbooks.add
    
          dim arr(19,9) 
          for i = 1 to 20
             for j = 1 to 10
                arr(i-1,j-1) = i*j
             next
          next
    
          dim rng
          set rng = wb.Activesheet.Range("A1").Resize(20,10)
    
          rng.value = arr
    wb.Charts.Add
          wb.ActiveChart.ChartType = 70 'xl3dPieExploded
          wb.ActiveChart.SetSourceData rng, 2 ' xlColumns
          wb.ActiveChart.Location 2, "Sheet1" 'xlLocationAsObject
    
          for i = 1 to 360 step 30
             wb.activechart.rotation = i
          next
          app.UserControl = true       end sub
</SCRIPT></BODY>
</HTML> 

解决方案 »

  1.   

    看看你传入的strLocation值是否符合javascript语法!
      

  2.   

      调用该函数的语句是:      
    <p><input type='button' value='打印' name='B1' onclick="javascript:OpenExcel('http://127.0.0.1/Gradmin/print/ysjytj.xls')"></p>
      

  3.   

     Say to net_lover:如何用VbScript or JavaScript修改原*.xls文件
      

  4.   

    在网页中打开WORD文件?
       要用到期ActiveX控件。
       在Front Page 中有提供。