RunApp
Action Important: 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 Excel, Microsoft Word, or Microsoft PowerPoint, from within Microsoft Access. For example, you may want to paste Excel spreadsheet data into your Access database. Note that you can't run the RunApp action in Microsoft Visual Basic. Use the Visual Basic Shell function instead. The RunApp action has the following argument. Here is an example of a command line: "C:\Program Files\Microsoft Office\Office10\excel.exe" "C:\WeeklyHitRate\UMC12i_HitRateMacro.xls"
Remarks: You can transfer data between the other application and Access by using the Microsoft Windows dynamic data exchange (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. 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. |