Call an Access(already running) macro from Word, Office 2013

FAB1

Registered User.
Local time
Today, 18:58
Joined
Jul 27, 2007
Messages
40
Hi All
I have been trying to improve an import routine in our office DB. The issue I am having is calling / triggering a macro in the “already running” office DB from Word. All the examples I have found are all based on opening a new instance of Access.

The already open db is = "C:\Tracker Local\TrackerFE\Tracker_FE.accdb"
macro to run = “mac_InTray”

Can’t find any other code that doesn’t use the Application.OpenCurrentDatabase Method

Help?
Office2013
 
set appAccess=GetObject(fulldatabasepath)

and you can run a function by

result = appAccess.Run("NameOfMyFunction", someParameter)


how to run a macro i dunno, probably something similar
 
how to run a macro i dunno, probably something similar
appAccess.DoCmd.RunMacro

However, I would do it the function way like spikepl explained. Convert your macro to a Public function. There's a button that can do the conversion for you.
 
Thanks guys just the push i needed:)
Cheers
FAB1

Code:
Sub StartAccess_Import_Macro()
   
  Dim appAccess As Access.Application
  Set appAccess = GetObject("C:\Tracker Local\TrackerFE\Tracker_FE.accdb")
        appAccess.DoCmd.RunMacro "mac_InTray"
  Application.Quit
   
  End Sub
 

Users who are viewing this thread

Back
Top Bottom