<%@ Language=VBScript %>
<%
set objExcelApp=CreateObject("Excel.Application")
objExcelApp.DisplayAlerts=false
objExcelApp.Application.Visible=true
strAddr=Server.MapPath("k.xls.")
objExcelApp.WorkBooks.Open(strAddr)
set objExcelBook=objExcelApp.ActiveWorkBook
set objExcelSheets=objExcelBook.Worksheets
set xlsheet=objExcelBook.Sheets(1)
dim hang ,lie
hang=xlsheet.UsedRange.Rows.Count
lie=4
response.write (hang)
response.write (lie)
i=1
response.write "<table cellpadding=0 cellspacing=0 border=1 width=300>"
while xlsheet.cells(i,1)<>""
response.write "<tr>"
response.write " <td height=40 align=center width=50>" & xlsheet.Cells(i, 1) & "</td>"
response.write " <td height=40 align=center width=50>" & xlsheet.Cells(i, 2) & "</td>"
response.write " <td height=40 align=center width=50>" & xlsheet.Cells(i, 3) & "</td>"
response.write "</tr>"
i=i+1
wend
response.write "</table>"
set xlsheet=nothing
set xlstock=nothing
objExcelApp.Quit
%>
在以上程序中已得到行,但列不知怎样得到????
作者: 118.88.171.* 2008-4-4 20:53 回复此发言
--------------------------------------------------------------------------------
4 回复:如何得到行和列?????????????
asnd
作者: asp_ajax 2008-4-4 20:56 回复此发言
--------------------------------------------------------------------------------
5 回复:如何得到行和列?????????????
hang=xlsheet.UsedRange.Rows.Count
就是得到的行数
但列数应如何得到???????????