RunApp Macro Action

Security  Use caution when running executable files or code in macros or applications. Executable files or code can be used to carry out actions that might compromise the security of your computer and data.

You can use the RunApp action to run a Microsoft Windows-based or MS-DOS-based application, such as Microsoft Office Excel 2007, Microsoft Office Word 2007, or Microsoft Office PowerPoint 2007, from within Microsoft Office Access 2007. For example, you may want to paste Excel spreadsheet data into your Access database.

 Note   This action will not be allowed if the database is not trusted. For more information about enabling macros, see the links in the See Also section of this article.


The RunApp action has the following argument.

Action argument Description
Command Line The command line (command line: The string of characters used to start an application.) used to start the application (including the path and any other necessary parameters, such as switches that run the application in a particular mode). Enter the command line in the Command Line box in the Action Arguments section of the Macro Builder pane. This is a required argument.


The application selected with this action loads and runs in the foreground. The macro (macro: An action or set of actions that you can use to automate tasks.) containing this action continues to run after starting the application.

You can transfer data between the other application and Access by using the Microsoft Windows dynamic data exchange (Dynamic Data Exchange (DDE): An established protocol for exchanging data between Microsoft Windows-based programs.) (DDE) facility or the Clipboard. You can use the SendKeys action to send keystrokes to the other application (although DDE is a more efficient method for transferring data). You can also share data among applications by using automation (Automation: A way to work with an application's objects from another application or development tool. Formerly called OLE Automation, Automation is an industry standard and a feature of the Component Object Model (COM).).

MS-DOS-based applications run in an MS-DOS window within the Windows environment.

In Windows operating systems, there are a number of ways to run an application, including starting the program from the Windows Explorer, using the Run command on the Start menu, and double-clicking a program icon on the Windows Desktop.

You can't run the RunApp action in a Visual Basic for Applications (VBA) module. Use the VBA Shell function instead.

Applies to:
Access 2007