Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gordon,
Set a reference to the Microsoft ActiveX Data Objects library and use code like the following: Dim CN As ADODB.Connection Dim RecSet As ADODB.Recordset Dim DBName As String Dim TableName As String Dim StartCell As Range ' ' Change these there lines to the appropriate values. ' DBName = "C:\Path\Database.mdb" TableName = "TableName" Set StartCell = Range("A1") Set CN = New ADODB.Connection CN.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & DBName & ";" Set RecSet = New ADODB.Recordset RecSet.Open "SELECT * FROM " & TableName, CN StartCell.CopyFromRecordset RecSet RecSet.Close CN.Close -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Gordon Cartwright" wrote in message ... -----Original Message----- There are examples for importing from Access at: http://www.erlandsendata.no/english/...odao/index.htm HTH, Merjet Hi... The examples on that site are too specialist and look at importing just 1 field from an access database into 1 column into Excel, when I have 20 to do. I'm also not skilled enough to adapt that code. Any further help would be grateful... GC |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Query from Access into Excel cause Access to go to read only | Excel Discussion (Misc queries) | |||
Can Excel access data from Access?! | Excel Discussion (Misc queries) | |||
Access Form In An Access Report (SubForm) Question | Links and Linking in Excel | |||
Using Excel with Access | Excel Discussion (Misc queries) | |||
export access to excel. change access & update excel at same time | Excel Discussion (Misc queries) |