Gotta go with Steve on this one. Humbertogo, can you post the whole code you're using??
Thanks CADaver. The way I/we interpreted the Op's question is that his original code
works (he says so). The problem he is having is with the *error* function. I
assume that the Op's code is part of a routine which crashes when the user cancels or the routine ends.
The other view, is that the Op's code does not work and is causing the *error* function to execute. And thus appears to be an error in the *error* function, but this error should be capture while freezing the layers and therefore avoiding the error in the *error*. Whew..
Anyhow, it interesting to see so many ways to "skin a cat". I just not sure what cat we should be skinning...