notebooks – Is this a bug: If I use NotebookEvaluate, then I can’t abort a While loop

I have a notebook Main.nb. This notebook contains a While(...) loop that takes about twelve hours to run. I have a second notebook called DataPreparation.nb. As the name suggests, the contents of DataPreparation.nb should be evaluated before the While(...) loop mentioned above.

Scenario 1 (with no bug):

  1. From DataPreparation.nb notebook, Select All and Evaluate.
  2. Switch to Main.nb notebook and start evaluation of While() loop.
  3. If I need to abort the twelve hour While() loop, I use Alt+. and it promptly
    stops. Good.

Scenario 2 (with the bug)

  1. From Main.nb, I invoke this command:NotebookEvaluate("DataPreparation.nb", InsertResults -> False).
  2. Start evaluation of While() loop.
  3. If I need to abort the twelve hour While() loop, I use Alt+. The abort command is ignored.
  4. To abort the twelve hour process, I must quit Kernel. I lose my work.

It appears that after I have used NotebookEvaluate, Mathematica loses track of where the abort command should be directed. I know that is an imprecise description of the problem, but it is the best I can do.

ps. This question is different from the question here. The difference is that the loop which can not be aborted is not contained in EvaluateNotebook("DataPreparation.nb"). In other words, calling an outside notebook anywhere in Main.nb creates the problem.