I can read from a closed Excel file and run a Query. Is it possible to read from an Excel workbook that is already open. For example, I want to query data is sheet 4 and write to sheet 1. Here is what I have so far that reads from a different spreadsheet:

Dim oConn As New ADODB.Connection
Dim oRS As New ADODB.Recordset
Dim i As Integer

oConn.Provider = "Microsoft.Jet.OLEDB.4.0"
oConn.Properties("Extended Properties").Value = "Excel 8.0"
oConn.Open "C:\Documents and Settings\langd6\Desktop\dave_percent\Book1.xls"

oRS.Open "Select * from [Sheet1$] where WJXBFS1 = 102", oConn, adOpenStatic

i = 1
Do Until oRS.EOF
Cells(i, 1) = oRS!RESIDENT_AGENT_NB
oRS.MoveNext
i = i + 1
Loop

oRS.Close
oConn.Close