|
-
Jul 31st, 2000, 11:37 AM
#1
Thread Starter
Addicted Member
I have a web-page running ASP. I want to bring in an excel file, and dissect it (i.e. get all the column headings, and extract all data) to insert the info into a database.
How can I programmatically (in VBSCript) pull out this data?
Thanks.
dvst8
Secret to long life:
Keep breathing as long as possible.
-
Jul 31st, 2000, 12:06 PM
#2
Lively Member
I wouldn't try to load an excel spreadsheet. Try using XML. MSDN has a sample with good code on how to build an XML file from an excel spreadsheet and then it has a server component that does the parsing to drop the data into a db.
Excel to XML code:
http://msdn.microsoft.com/library/techart/fmcorpxml.htm
Server component:
http://msdn.microsoft.com/library/te...corpcmpnts.htm
-
Jul 31st, 2000, 12:10 PM
#3
Thread Starter
Addicted Member
thanks. will check that out!
dvst8
Secret to long life:
Keep breathing as long as possible.
-
Jul 31st, 2000, 01:01 PM
#4
Thread Starter
Addicted Member
i looked over this stuff, but i don't think XML is the direction i want to take.
i would prefer to parse the .xls file directly in my ASP code (using VBScript). can this be done? it should be OK if I can access the Excel Object model from vbscript. If so, How?
thanks.
dvst8
Secret to long life:
Keep breathing as long as possible.
-
Jul 31st, 2000, 06:58 PM
#5
Hyperactive Member
If all you need to know is how to access the excel objects in vbscript, you just need to set you variables in the following manor:
Code:
Dim objxl, objbk, objsh
Set objxl=CreateObject("Excel.Application")
Set objbK = objXL.Workbooks.Open("c:\somedirectory\somefile.xls")
Set objsh = objbK.ActiveSheet
And that is it. It is basically the same as regular vb, only you don't have access to Excel's events, and obviously you have to create the objects. If you need more help, just ask.
Hope this is helpful.
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
|