Here is some generic code to display data from a spreadsheet of unknown
column count. It's okay, although Aaron may yell at me for the nested
loops.
<%
Dim oADO, sConnection, sSQL, rsSheet, aVals
Dim x, y
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\PathOnServer\file.xls;Extended Properties=""Excel
8.0;HDR=No;IMEX=1"""
sSQL = "SELECT * FROM [Sheet1$]"
Set oADO = Server.CreateObject("ADODB.Connection")
oADO.Open sConnection
Set rsSheet = oADO.Execute(sSQL)
If Not rsSheet.EOF Then aVals = rsSheet.GetRows()
rsSheet.Close : Set rsSheet = Nothing
oADO.Close : Set oADO = Nothing
If IsEmpty(aVals) Then
Response.Write "The worksheet is blank."
Response.End
End If
%>
<table>
<tr>
<% For y = 0 To UBound(aVals, 1) %>
<td><b><%=aVals(i, 0)%></td>
<% Next %>
</tr>
<% For y = 1 To UBound(aVals, 2) %>
<tr>
<% For x = 0 To UBound(aVals, 1) %>
<td><%=aVals(x, y)%></td>
<% Next %>
</tr>
<% Next %>
</table>
Ray at work
"Benny Alexander" <ag_BennyREMOVETHIS@Yahoo-Remove_This.com> wrote in
message news:el**************@TK2MSFTNGP10.phx.gbl...
Dear All,
I have a problem, which needs your ideas.
We have a excel document, which is been updated regularly. After everyday
updating, we export as HTML file and upload it.
As a ASP programmer, I want to write a script, which can parse this excel
file and make it as a web ready file.
Is there any simple way to do this?
Our data entry operator, is very new to computers and all he know is a
little in Excel.
Kindly pls help,
Warm Regards,
Benny