This worked for me based on a test I did on my computer. You may need to add the full path for msaccess. Also, This will open an instance of Access in order to run the macro, so you'll probably want to add a Quit command to the macro to give control back to Excel.
Dim objAcc As Access.Application
Set objAcc = New Access.Application
With objAcc
.OpenCurrentDatabase "C:\Accessdb.mdb"
.DoCmd.RunMacro ("runmac")
.CloseCurrentDatabase
.Quit
End With
Set objAcc = Nothing
[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]
Help us help you. Please read FAQ181-2886 before posting.
Sure. In the VB Editor, go to Tools > References and check the box beside Microsoft Access X.X Object Library (the X.X represents whatever version number you have).
[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]
Help us help you. Please read FAQ181-2886 before posting.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.