Associate
I've got a problem with one of my spreadsheets, which I never had before. I used to work on my old computers, but won't work on my new laptop, or a friend's laptop. I scoured the internet to no avail, and can't fix my problem.
It's simply an Excel spreadsheet which uses DAO to access a database (Access 2003). Whenever it gets to 'OpenDatabase' it has the error message "Run-time error '429'; ActiveX component can't create object".
I've re-written the code to illustrate the problem :
I have referenced Microsoft DAO 3.6 Object Library, and the file exists in
C:\Program Files (x86)\Common Files\microsoft shared\DAO dao360.dll is version 3.60.9756.0.
Weirdly, when I run it in VB6, it works properly, using the same DAO360.dll.
Any ideas?
It's simply an Excel spreadsheet which uses DAO to access a database (Access 2003). Whenever it gets to 'OpenDatabase' it has the error message "Run-time error '429'; ActiveX component can't create object".
I've re-written the code to illustrate the problem :
Sub GetBarges()
Dim DB As Database
Dim RS As Recordset
' C:\Database\Barge.mdb
' C:\Database\Barge-2003.mdb
' C:\Database\Project48-2003.mdb
' Open the Barge database, move down to the relevent barge
Set DB = OpenDatabase("C:\Database\Barge-2003.mdb")
Set RS = DB.OpenRecordset("Barges")
Do Until RS.EOF = True
Debug.Print RS.Fields("BargeName")
RS.MoveNext
Loop
RS.Close
DB.Close
End Sub
Dim DB As Database
Dim RS As Recordset
' C:\Database\Barge.mdb
' C:\Database\Barge-2003.mdb
' C:\Database\Project48-2003.mdb
' Open the Barge database, move down to the relevent barge
Set DB = OpenDatabase("C:\Database\Barge-2003.mdb")
Set RS = DB.OpenRecordset("Barges")
Do Until RS.EOF = True
Debug.Print RS.Fields("BargeName")
RS.MoveNext
Loop
RS.Close
DB.Close
End Sub
I have referenced Microsoft DAO 3.6 Object Library, and the file exists in
C:\Program Files (x86)\Common Files\microsoft shared\DAO dao360.dll is version 3.60.9756.0.
Weirdly, when I run it in VB6, it works properly, using the same DAO360.dll.
Any ideas?