Creating a Macro

ClosedBefore you start

  • Define the procedure you want automated and then write out the steps.
  • If you are creating a macro that updates your database, make a copy of your accounting data to use while creating the macro. (This prevents your live data from being damaged before the macro is fully tested.)

To create a macro:

  1. On the Sage 300 Desktop, click Macro > Record Macro.
  2. Record your steps using the Record Macro command, or write the macro directly using the Edit Macro command. For steps on recording a macro, see Record your steps.

    In either case, your macro is displayed in the Microsoft Visual Basic Editor.

  3. Click File > Save Project to save the macro file.
  4. On the Sage 300 Desktop, click Macro > Run Macro > [macro name] > Open to run the macro to see if it works properly.
  5. To debug or edit the macro, click Macro > Edit Macro > [macro name] > Edit to open the macro in the Microsoft Visual Basic editor.
    • Debug the macro using the Edit and Debug menus.
    • Click Tools > Options from the menu, and select options on the General tab on the Options form to check for errors.
    • Fine-tune the macro to make it more efficient and easier to use.
    • Add comments explaining the macro procedures to help others who use it later.
  6. Save the final macro.