Hi all,
I'm trying to make an .exe using VB 6.0 to call an MS Access macro. I found the following code on the web.
this works great, and i was able to get an test .exe to work.
but the purpose of this is for me to send this .exe off to users that do NOT have MS Access installed on their desktop.
so when i try this .exe on an VB and MS Access free machine, i get an "Runtime error 429, ActiveX component can't create object"
Does anyone know what this error means?
I have other VB .exe that retrieve data records in MS Access databases, and paste them on Excel.. and they all work properly on VB and MS Access free machines.
So what's so different for calling a MS Access macro?
please let me know
Thanks so much
Hosackies
I'm trying to make an .exe using VB 6.0 to call an MS Access macro. I found the following code on the web.
Code:
Set your project references to MS Access x.x object type library and try running this code:
Public Sub RunAccessMacro(strDB As String, strMacro As String)
'================================================================
Dim AccessDB As Access.Application
Set AccessDB = New Access.Application
With AccessDB
.OpenCurrentDatabase strDB
.DoCmd.RunMacro strMacro, 1
'.Visible = True 'you decide
.CloseCurrentDatabase
End With
Set AccessDB = Nothing
End Sub
Private Sub btnRunMacro_Click()
'================================
RunAccessMacro App.Path & "\nwind.mdb", "Suppliers"
End Sub
NOTE: the following line "... App.Path & "\nwind.mdb", "Suppliers" will have to be replaced with YOUR database path and YOUR macro
name.
this works great, and i was able to get an test .exe to work.
but the purpose of this is for me to send this .exe off to users that do NOT have MS Access installed on their desktop.
so when i try this .exe on an VB and MS Access free machine, i get an "Runtime error 429, ActiveX component can't create object"
Does anyone know what this error means?
I have other VB .exe that retrieve data records in MS Access databases, and paste them on Excel.. and they all work properly on VB and MS Access free machines.
So what's so different for calling a MS Access macro?
please let me know
Thanks so much
Hosackies