hmm... Well first, SET the frame range NOT select. Meaning all you have to do is make sure your timeline min and max values are set to the start and end frames you are interested in, sorry for the confusion.
Why its crashing I'm not sure (I'm on a Mac and it works fine, and nothing is platform specific in the script). Try these things...
-Try it without selecting in the timeline .
- trying executing this code (this just specifies the place the file will be saved and prints the path in the script editor):
string $textFilePath[] = fileDialog2 -caption "Save CSV As..." -fm 0 -fileFilter "*.csv" -dialogStyle 1
;
print $textFilePath[0];
-if that doesn't crash, try saving to a different place on your machine... there may be a permissions error where Maya isn't allowed to create the file.
-some other things to try would be to change the ".csv" in the first line to something like ".txt" (maybe it just doesn't like creating the csv on the PC)
-It shouldn't matter at all, but you can delete "-dialogStyle 1" fromt the first line as well. That simply specifies whether its an OS dialog box or a maya dialog box. It shouldn't matter, but it's something to try.