"Crashing" and "hanging" are two very different things. Please be specific when describing your problem and what steps lead to the problem (and when it actually occurs). Given the lack of error checking, are you certain that the file was actually created? Does it import correctly? Do you see it in the datawindow and it is only after you import it and do other things in the application that some problem occurs?
In other words, what leads you to believe that this particular feature is the source of the problem?