实例解析ASP程序中输出Excel文件(2)_ASP教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:怎样用asp程序读取网站的alexa世界排名
平时每逢alexa排名更新时,我都需要将所有相关的同类网站的排名整理一下,看一下这些对手网站的排名更新情况。做的多了,也就烦了,虽然也才30多个网站,但一个个看下来也有点累。因此,想

实现的代码和上篇日志差不多,简单的如下:

以下为引用的内容:

<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>

分享:怎样做到一个网站空间多个域名访问
一个网站空间,但是却可以实现多个域名的访问的一段ASP代码: 以下为引用的内容: % if Request.ServerVariables(SERVER_NAME)=&q

来源:模板无忧//所属分类:ASP教程/更新时间:2009-05-18
相关ASP教程