Run-Time error '429' ActiveX component can't create object

artefact

New Member
Joined
Jul 27, 2015
Messages
17
Hello,
I'm struggling with a VBA error at the following line: marked in bold:
Sub test()
Dim strDBName As String
Dim strMessage As String
Dim appAccess As Access.Application
Dim vartest As String
Dim hd As String
Dim hf As String
Dim databasename As String
databasename = "test.accdb"
Dim currentweek As String
strDBName = ThisWorkbook.path & "\" & databasename
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set appAccess = New Access.Application
With appAccess
.OpenCurrentDatabase strDBName
.Visible = False ' Useful for debugging when true
.Eval ("semaineencours()")
End With
currentweek = appAccess.Eval("semaineencours()")
MsgBox currentweek
With appAccess
.CloseCurrentDatabase
.Quit
End With
End Sub

Here is the error: Run-Time error '429' ActiveX component can't create object


Everything is working well with access 2010 installed. When I run this code in Excel 2010, I've got no issue.
I'm trying to run this same piece of code on a different machine on which I've installed access 2010 runtime.
I'm still facing this error? It is really possible to run excel 2010 vba code with the access 2010 runtime?
I've installe run-tim 32 bit on Win7

Thanks for your help.
Arte


 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I don't believe you can use automation with the Access runtime.
 
Upvote 0
In my experience it's pretty rare that you actually need to automate the Access application. For the most part you want to query the database in some way, which doesn't require Access at all.
 
Upvote 0
Hello,
For those who need to automate Access application (with its RUN TIME env as well), with access. Here is the way set the object between those application:

Dim bddobjet As Object
databasenamepath = ThisWorkbook.path & "\prev.accdb"
'********************Object to handle database)
Set bddobjet = accessobjet(databasenamepath)


Function accessobjet(databasenamepath As String) As Object
strProgramName = "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE"
strArgument = databasenamepath
Call Shell("""" & strProgramName & """ """ & strArgument & """", vbMinimizedNoFocus)
Set accessobjet = GetObject(, "Access.Application")
End Function

With bddobjjet set, you can call VBA function from the accdb file for instance.

Arte
 
Upvote 0
In my experience it's pretty rare that you actually need to automate the Access application. For the most part you want to query the database in some way, which doesn't require Access at all.
Hello,
For those who need to automate Access application (with its RUN TIME env as well), with access. Here is the way set the object between those application:

Dim bddobjet As Object
databasenamepath = ThisWorkbook.path & "\prev.accdb"
'********************Object to handle database)
Set bddobjet = accessobjet(databasenamepath)


Function accessobjet(databasenamepath As String) As Object
strProgramName = "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE"
strArgument = databasenamepath
Call Shell("""" & strProgramName & """ """ & strArgument & """", vbMinimizedNoFocus)
Set accessobjet = GetObject(, "Access.Application")
End Function

With bddobjjet set, you can call <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> function from the accdb file for instance.

Arte
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top