Editing add-ins

Editing add-ins

It is often necessary to edit an add-in to make improvements or add new functionality.

This topic demonstrates how to edit an add-in.

Steps:
  1. Verify that the initial add-in project works.

    Assuming you have already created an add-in project, this step is a little redundant; however, it is still valuable in cases where there has been time between the first version and the update you are about to do. In addition, testing and ensuring functionality gives you a base for moving forward with modifications. Here are some considerations for this step in the process:

    • Test your add-in on a machine using the same workflows used by the individuals who use the add-in.
    • Back up your existing add-in project in case you need to roll back the changes.
    • If errors exist in your current version of the add-in, make sure you can reproduce them in your development environment.
      NoteNote:

      Do not fix the code before making a backup.

  2. Make improvements or add new functionality.

    Now that you have a backup of the add-in project, you can begin making edits:

    1. Making edits to the project settings or add-in contents.
      • If you require updating the settings, such as the description, image, or version, launch the Python Add-In Wizard and browse to your existing project folder (not the backup project).
        NoteNote:

        A message box will display informing you a backup of the existing Python script is saved and a new source script will be created when you save your changes. The backup script is necessary since there is no way of knowing if new add-in types (such as button) are created.

      • If edits are made that do not change the Python script, delete the newly created script from your working folder and rename the backup to its original name.
      • If new add-in types are added or changes are made to the class names, copy the code from the backup script into your newly created script, as necessary.
    2. Making edits to the Python script.
      • If you only need to update and add functionality to the existing add-in script, there is no need to open the Python Add-In Wizard. Rather, just edit the Python script to make the necessary changes and save.
        NoteNote:

        Do not rename the class inside the script. The class name is referenced in the config.xml file. Changing the name in the script requires updating the config.xml.

  3. Test your edits.

    Once you have finished making edits, it is important to rebuild the add-in file and test the add-in before sharing it. For this information, see Testing an add-in.

  4. Reshare your add-in.

    After testing and confirming the add-in works as expected, you are ready to deploy and share the add-in. For more information, see Sharing add-ins.

3/3/2014