Hi lisa,
I think you should use ado to connect to excel. ADO is a tool for making
recordsets from external/internal databases.
Now i have never connected to excel using ado before but i did some reserch
and this is what i got to work.
Dim rs As ADODB.Recordset
Dim sSQL As String
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
cnn.Open "Provider= Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= C:\Test\Book1.xls;" & _
"Extended Properties='Excel 8.0;IMEX=1'"
sSQL = "SELECT Name, Dates " & _
"FROM [Sheet1$] "
Set rs = New ADODB.Recordset
rs.Open sSQL, cnn, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
MsgBox rs!Name & " , " & rs!Dates
End If
If you have more questions about ADO, there is a ADO newsgroup in the "Data
Access" MSDN Newsgroups.
Also, one of the links i found helpful was:
http://support.microsoft.com/kb/257819/EN-US/
Hope this helps.
Good Luck!
:
I am trying to create a database for a small company. This is the first time
I have attempted this at this level. I want to take data that is compiled by
middle management in excel worksheets and run queries in a secure database on
the information in the worksheets.