I need to run a set of Access macros from an Excel sheet. Trying to get just one to work for a start. I found some code which looks like it should work. The code should open Access, open the specified db, run a specified macro, close the db. It opens Access ok but then puts up a warning "can't find mac_xxx" without apparently even opening the db. The db and macro names match what's in the code. Any ideas? I'm using Access 2013. I think the code may have been written for a previous version. Code below.
'Opens Microsoft Access and the file Fred.accdb
Shell ("C:\Program Files (x86)\Microsoft Office\Office15\msaccess.exe C:\Documents\Fred.accdb")
'Initiates a DDE channel to Microsoft Access
Chan = DDEInitiate("MSACCESS", "system")
'Activates Microsoft Access
'Runs the macro "mac_XXX" from the Fred.accdb file
Application.DDEExecute Chan, "mac_XXX"
'Terminates the DDE channel