DAO objects with late binding in Excel?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi there,
I am trying to write a macro that will take info from
excel and write it to an access database. The macro will
be used by people who don't have Access on their
computers, and who don't have references to the DAO object
library. I can get it to work if they go into the VB
editor and select Tools/references and set the reference,
but I would prefer not to have to walk everyone through
that process.
I am thus trying to declare my objects as generic object
types and use late binding like thus:

Sub input()
Const Path As String = "C:\Test\LoginTest.mdb"
Dim db As Object
Dim rs As Object
Dim objAcc As Object
Dim ws As Object

Set objAcc = CreateObject("DAO.DBEngine")
Set db = objAcc.OpenDatabase(Path)
Set rs = db.OpenRecordset("Control Table")
rs![Control Processor]=Range("A1").value
rs.Close
db.Close
Set objAcc = Nothing
End Sub

But when I get to the OpenDatabase method part, I keep
getting "Out of memory" error. Anyone know how I could
accomplish my goal?

TIA
Chris
 
Back
Top