Hi Strad,
> Is still would like to know the best way off bringing
> data from the activex script into another source.
ADO. :)
> Is it to write a procedure to pick up data from excel and
> then to retrieve that from data from the activex script?
No, you'd just use ADO directly. If the excel file is on another
server somewhere that's okay - you can still use ADO. In fact,
whenever you're dealing **only with data** there isn't a good reason
to bring automation into it at all. The whole OLE automation thing
was really neat back in Windows 3.11 and Windows 95 - but we're in a
different world today where tools are specifically developed to
solve given needs, and OLE just aint the way to do it.
However, if you were in need of something to format the spreadsheet
so it could be printed with cute little borders and edges and page
titles and nonsense, then Excel Automation would be the way to go.
> So I would create an OLE in the program I wanted to get
> the data too and then activate a procedure and then on
> the next line pull the data from the activex script in
> my program?
No, it's actually very simple, I'm assuming you're using a vbs file
or something to access the excel data here, since you haven't really
given us much to go on. Here's a brief sample, expect to be annoyed
- a lot - if you run it exactly as it is. It effectively pops a
messagebox for EVERY record for the first column.
'// ========================================================
' WARNING: Vaporcode
' This code was NEVER tested in the IDE.
' It was written directly into this email.
'// ========================================================
' variables
Dim cn, rs, lIter
' create the objects
Set cn = CreateObject("adodb.connection")
cn.open "Provider=Microsoft.Jet.OLEDB.4.0;" _
"Data Source=C:\file.xls;" _
"Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
Set rs = cn.execute("SELECT * FROM [sheet1$]")
' enumerate stuff
While not rs.eof
liter = liter + 1
msgbox("record " & liter & ": " _
& rs.fields(0).value)
Rs.movenext
Wend
' clean up
Rs.close
Set rs = nothing
Cn.close
Set cn = nothing
'// ========================================================
Sorry, it's a bit rudimentary (30 seconds will do that), so don't
expect a whole lot out of it more than just a learning experience.
Save it out as "test.vbs" then drop to a command prompt (Assuming
you have a file "c:\file.xls") and type this:
cscript test.vbs
Enjoy.
Regards,
Shawn K. Hall
http://12PointDesign.com/
http://ReliableAnswers.com/
'// ========================================================
To see what is in front of one's nose requires a
constant struggle.
-- George Orwell
'// =======================================================
Rules : http://ReliableAnswers.com/List/Rules.asp
Home : http://groups.yahoo.com/group/vbHelp/
=======================================================
Post : [email protected]
Join : [EMAIL PROTECTED]
Leave : [EMAIL PROTECTED]
'// =======================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/vbhelp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/