Using FSO to get Excel data

  • Thread starter Thread starter RustyR
  • Start date Start date
R

RustyR

I hope there is an easy answer to this!

I have an active server page which dynamically shows all files in a
directory.
Based on the file name, using FSO, I use the first 5 chars to create a link
to another tool and MID to gather other info from the title which helps
populate other table cells.
My question is this:
Is there a way using VBScript to grab the value of a certain cell within the
spreadsheet?

Thanks in advance for any help!!

Regards,
Rusty
 
Rusty

You can use ADO to query ranges in closed excel files
without the need for excel to be installed on the server.

sPath = "D:\TestDB.xls"
Dim vTemp(4),i
Set oCon = CreateObject("ADODB.Connection")
Set oRst = CreateObject("ADODB.Recordset")
oCon.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Extended Properties=Excel 8.0;Data Source=" & sPath

oRst.Open "SELECT * FROM [Sheet1$A1:A4]", oCon, 3

'do your stuff...

If oRst.State Then oRst.Close
If oCon.State Then oCon.Close
Set oRst = Nothing
Set oCon = Nothing

Plenty to google on ADO in this group and elsewhere..
HTH

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


RustyR wrote :
 

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

Back
Top