Run Acess Macro

G

Guest

Hello
I have added a button to my spreadsheet that I would like to Run an Access
Macro.
When I execute my code I get "Method Or Data Member Missing". I have turned
on the MS Access object Reference
This is my code

Private Sub CommandButton1_Click()

Dim appAcc As Access.Application

Set appAcc = New Access.Application
appAcc.Visible = True
appAcc.Open "G:\Mypath\Myfile.mdb"
appAcc.RunMacro "MyMcaro"
appAcc.Quit
Set appAcc = Nothing

End Sub

What am I doing wrong?
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top