Excel to HTML conversion automation :: How to?

B

Benny Alexander

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
 
E

Egbert Nierop \(MVP for IIS\)

Benny Alexander said:
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.
I would not know why ASP has to do this type of task. Asp is made for real
time HTML tasks and not for daily static data :)
Just schedule a .vbs file using windows scheduler and you can read/write the
excel file using ADO and the provider=Jet.microsoft.oledb.4.0 driver.
 
B

Benny Alexander

I thought, using a upload object, I can upload and manipulate the excel work
sheet send the data in to a DB and read it again to prepare a HTML table.

I hope you are giving me a better way. Thanks. Could you please explain
little more.

Thanks again Egbert.

Regards,
Benny Alexander
 
R

Ray at

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
 
B

Benny Alexander

Thanks a lot Ray. This is a great help.

Benny
Ray at said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,138
Messages
2,570,799
Members
47,347
Latest member
RebekahStu

Latest Threads

Top