Running Macros in Access from Excel

  • Thread starter Thread starter Simon Dowse
  • Start date Start date
S

Simon Dowse

Hi,

Is there nayway to write some script in Excel that opens
Access, runsa pre-recorded macro and then closes Access?
I also want this to be invisible to the user.

Many thanks in advance,
Simon
 
You can do something like this:

Sub ljd()

Set db = GetObject("C:\DatabasePath\DatabaseName.mdb")
db.DoCmd.RunMacro ("SampleMacro")
db.Quit
Set db = Nothing

End Sub

tod
 

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

Back
Top