How can I start a macro in MS Access with database activities?

Hi all,
I am using the database activities to connect to a MS Access database. The connection is working fine :wink:
Now I would like to start the Macro “Gesamtabfrage” with these database activities. How can I do this? I want to avoid clicking the UI elements.

Any help is highly appreciated.

Thanks a lot in advance,

@Omit - Did you ever find a solution to this topic? I’m having the same issue currently…

dunno if you found the solution, but i will leave this where :slight_smile:

@MikeHoncho take a look :stuck_out_tongue:

@fmsimoes - That was actually the first thing I tried but ran into issues, likely because Access isn’t installed on the machine running the Execute Macro activity.

Here’s the error for reference:
Retrieving the COM class factory for component with CLSID {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

in that case i’m out of ideas :frowning:

Hi guys,
thank you for your reply.
I wanted to try this activity but we are not allowed to use it ;-(
So far I am double clicking the query in order to execute.
Still dont have a solution for it.

Try this: Use the start process activty.
First argument is the .exe of access. example : “C:\Program Files\Microsoft Office\Office16\MSACCESS.EXE”

Second argument is the database file “”“C:\User\Myself\Path with spaces works\MyDB.accdb”"" + " /x macro_name_here"

Triple quotes allows spaces in the name but doesn’t allow /x. So to handle both cases, you triple quote the path, then add on a single quote string. Note the space at the start of the second string ‘/x’ is a command line argument that allows specification of a macro name. I sometimes get a message saying I don’t have exclusive rights to the DB which may need to be handled separately. However, this should start Access, and then run a macro inside the DB specified.

Here is the support document from Microsoft.

Hi Brian,

thx a lot for your solution. I really appreciate your reply.
I was testing according to your description and it is working fine.

I only wish @uipath would provide an activity like the execute MSExcel macro for the execution of my MSAccess macro. Because the start process activity only starts the macro but doesnt know when its done.

Anyway your solution definitively made my automation even more stable.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.