|
-
Aug 1st, 2000, 11:24 AM
#1
Thread Starter
Addicted Member
Does anybody know where I can find the object model reference for navigation around an Excel Object in VBScript?
Reason being, I want to parse an excel file in an ASP page.
Any help appreciated.
tx
dvst8
Secret to long life:
Keep breathing as long as possible.
-
Aug 1st, 2000, 11:43 AM
#2
Lively Member
This page gives an overview of working with Excel objects.
http://msdn.microsoft.com/library/of...97/web/004.htm
You can also open VB and make a reference to the Excel object model. Then open the object viewer and select only the Excel library. This will display all of the objects in the Excel model.
You can also open the Visual Basic editor in Excel and open the Visual Basic help file and it will provide info on the object model. The VB help file for Excel doesn't install by default so you may have to run your set up program again for Office 97 and choose the VB help for Excel.
Hope this helps.
-
Aug 1st, 2000, 11:46 AM
#3
Hyperactive Member
The object model is exactly the same as in full blown VB-minus the events of course. If you need all the objects, just set a reference to the excel object in vb and then look at it in the object browser.
-
Aug 1st, 2000, 12:19 PM
#4
Thread Starter
Addicted Member
Secret to long life:
Keep breathing as long as possible.
-
Aug 1st, 2000, 12:58 PM
#5
Thread Starter
Addicted Member
better way!
instead of parsing the .xls file with code, i found a way to directly connect to it and treat it like a database!!
much easier!!
here's an example i found.
credit to bill wilkinson.
Code:
<HTML><BODY>
<%
' create and open the connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER=Microsoft Excel Driver (*.xls);" _
& "DBQ=" & Server.MapPath("FoodStore.xls")
Set RS = conn.Execute("Select * From [FoodStore$]")
%>
<TABLE Border=1 CellPadding=3>
<TR>
<% For f = 0 To RS.Fields.Count-1 %>
<TH><% = RS.Fields(f).name %></TH>
<% Next %>
</TR>
<% Do While Not RS.eof %>
<TR>
<% For f = 0 To RS.Fields.Count-1 %>
<TD><% = RS.Fields(f).value %></TD>
<% Next %>
</TR>
<% RS.MoveNext %>
<% Loop %>
</TABLE>
</BODY></HTML>
dvst8
Secret to long life:
Keep breathing as long as possible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|