[AccessD] Excel file in Access

MartyConnelly martyconnelly at shaw.ca
Mon Feb 7 14:36:24 CST 2005


You could use this type of recordset for your report

Dim oConn As New ADODB.Connection
Dim oRS As New ADODB.Recordset
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=C:\Book1.xls;" & _
           "Extended Properties=""Excel 8.0;"""

' Use a range with a specific address (for example, [Sheet1$A1:B10]).
' Use the sheet name followed by a dollar sign (for example, [Sheet1$] 
or [My Worksheet$]).
oRS.Open "Select * from [Sheet1$A1:B10]", oConn, adOpenStatic
 

oConn.Close


Dale Kalsow wrote:

>Good Afternoon,
> 
>I have an excel document that I need to take tabs or a range of cells from and include them in an access report. I am using office 2003.
> 
>Does any one know how to do this?
> 
>Thanks!
> 
>Dale
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list