以下为引用的内容:
<script language="vbscript">
set objExcelApp=CreateObject("Excel.Application") objExcelApp.DisplayAlerts=true
objExcelApp.WorkBooks.Open("http://XXX.XXX.XXX/XXX.xls") '完整网路地址的xls文件,这个文件已经设置好格式及打印样式,保存在服务器上 set objExcelBook=objExcelApp.ActiveWorkBook set objExcelSheets=objExcelBook.Worksheets set objExcelSheet=objExcelBook.Sheets(1) '====此处为对excel单元格进行填写数据的语句,如果是从数据库提取数据,可由后台程序生成这些语句,ASP中的示列: '如:response.write "objExcelSheet.Range(""B2"").Value="""&rs("XXX")&"""" '或 objExcelSheet.Range("B2").Value="<%=rs("XXX")%>"
objExcelSheet.Range("B2:k2").Value=Array("Week1","Week2","Week3","Week4","Week5","Week6","Week7") objExcelSheet.Range("B3:k3").Value=Array("67","87","5","9","7","45","45","54","54","10") objExcelSheet.Range("B4:k4").Value=Array("10","10","8","27","33","37","50","54","10","10") objExcelSheet.Range("B5:k5").Value=Array("23","3","86","64","60","18","5","1","36","80") objExcelSheet.Cells(3,1).Value="InternetExplorer" objExcelSheet.Cells(4,1).Value="Netscape" objExcelSheet.Cells(5,1).Value="Other" '==================
'objExcelApp.Quit 'set objExcelApp=Nothing
</script> |