Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a huge set of code to accomplish a data transformation. I have saved this set of code as eg:

            RawDataTonnages =Import[Tab2excelFileLocation, {"Sheets", "Tonnages"}]; 
 (*...blah blah transformation and setting up graphs and stats tables...*)
            Tab3RawDataTonnages =Import[Tab3excelFileLocation, {"Sheets", "Tonnages"}]
 (*...blah blah transformation and setting up graphs and stats tables...*)
 Button["Recalculate", codeset]

Later I want to use the two FileNameSetter buttons to locate new files. Once this has been done I then want to press the Recalculate button to re-evaluate 'codeset' so that my answers reflect the data from the new files.

I have get this to work partially - when I press the button the codeset re-evaluates for the 1st filename setter only even though I have changed both. If I test not by using the button but by re-evaluating the code using shift+enter it works for both filename setters. Why is this happening, I can't understand it.

share|improve this question
Can you post a minimal code example which demonstrates the problem you are experiencing, this will help others reproduce the problem and thus find a solution? – image_doctor Dec 11 '12 at 10:51
YES! Thanks so much for explaining that. The Method->"Queued" worked. – Lara Jordan Dec 11 '12 at 11:17

Try using Button["Recalculate", codeset, Method->"Queued"]

Shift+Enter starts a queued evaluation, while the button, by default, a preemtive one, which blocks the front end and has a timeout

share|improve this answer
THANK YOU MAN!!! – shdrums9 Apr 12 '13 at 20:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.