I am trying to extract some Material data to a file using an input script. The material numbers are read in from a range of numbers (e.g. 400000 to 400999. Unfortunately some of the materials do not exist and therefore the script stops with an error. Is there any way for the input script to ignore the error and move on to the next number without any action by the user?

Yes, this is possible. Use the "OnError=" option in the Enter statement.