An operation can't be carried out if it would invalidate the current state of the project. This error has the following cause and solution:
Stop execution of the current code, and then retry the operation.
Although you can modify modules in the project while they aren't actually running, you can't make modifications to a running module. To make such changes, you must stop the module from running, make the additions or changes, and then restart execution.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).