This article discusses how to create and how to run macros to perform various tasks in Microsoft Dynamics GP and in Microsoft Business Solutions - Great Plains. The macros can be used to automatically start the program, to generate reports, and to perform other tasks. This article also discusses how to use Scheduled Tasks to run the macros.

More Information

  1. To create and to run a macro that automatically generates reports or that performs other tasks, follow these steps:

    1. Start Microsoft Dynamics GP. Do not log on.

    2. In the Welcome to Microsoft Dynamics GP dialog box, press ALT+F8 to start recording the logon macro. Name the macro, and then save it to the installation folder for Microsoft Dynamics GP.

      Note If the macro is not in the installation folder, you will receive the following error message:

      Cannot open macro

    3. In the Server box, click a server.

      Note It is important to select the appropriate server when you create the macro, even if the correct server was selected when you started Microsoft Dynamics GP.

    4. In the User ID field, enter the appropriate information for the user who will generate the report or who will generate other tasks.


      • It is important to do this step when you create the macro, even if the correct user ID is displayed when you start Microsoft Dynamics GP.

      • To make sure that the desired user ID is recorded within the macro, we recommended that you delete any existing user ID from the field, move to the Password field, return to the User ID field, and then enter the desired ID.

    5. In the Password field, type the password for the user who is selected in step 1d.

    6. Click OK. The Company Login dialog box opens.

    7. From the Company list, click the company for which you want to log on, and then click OK.

      Note It is important to select the appropriate company when you create the macro, even if the correct company is selected when the Company Login window opens.

    8. Complete all the steps that are required to process the reports or other tasks within this company.

    9. On the File menu, click Exit to close Microsoft Dynamics GP.

  2. Use a text editor, such as Notepad, to add the following line as the second line of the macro.

    Logging file 'macro.log'

    Note This line prevents any message that is displayed by the macro from being displayed. Therefore, such a message cannot prevent a logon to Microsoft Dynamics GP. An example of such a message is the total run time of the macro. All messages that are generated by the macro are written to the Macro.log file.

  3. To start Microsoft Dynamics GP by using the macro, create a batch file. To do this, follow these steps:

    1. Create a file that has a .bat file name extension. For example, create a file that is named DynamicsGP.bat.

    2. Use a text editor, such as Notepad, to open the batch file.

    3. Paste the following line into the .bat file.

      dynamics dynamics.set XXX.mac cd c:\Dynamics GP installation path

      Note Replace XXX.mac with the name of the macro file that you assigned in Step 1b. Replace Dynamics GP installation path with the installation path of Microsoft Dynamics GP on this computer. For example, type the following path:

      Program Files\Microsoft Dynamics\GP

    4. Save the changes, and then close the batch file.

  4. Configure Scheduled Tasks to run the batch file that will run the macro that you created. For more information about how to use Scheduled Tasks, see the Windows manuals or Windows online documentation. To see the online documentation, click the following link:

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!