直播中
序號字段不為空
注意:excel 起始行是1而不是為0
<%@language=vbscript %>
<%
Set xlApp = server.CreateObject("Excel.Application")
strsource = "c:\excel\book1.xls"
Set xlbook = xlApp.Workbooks.Open(strsource)
Set xlsheet = xlbook.Worksheets(1)
i=1
response.write "<table cellpadding=0 cellspacing=0 border=1 width=500>"
while xlsheet.cells(i,1)<>""
response.write "<tr>"
response.write " <td height=20 align=center width=100>" & xlsheet.Cells(i, 1) & "</td>"
response.write " <td height=20 align=center width=200>" & xlsheet.Cells(i, 2) & "</td>"
response.write " <td height=20 align=center width=200>" & xlsheet.Cells(i, 3) & "</td>"
response.write "</tr>"
i=i+1
wend
response.write "</table>"
set xlsheet=nothing
set xlbook=nothing
xlApp.quit '千萬記住要加這一句,否則每運行一次你的機器里就增加一個excel進程,而且無法釋放。我試過"set
xlApp=nothing"是不行的。
%>