Hi I am trying to make sure that I give my worksheet a unique name in the workbook. To do this I create a name that really really really should be unique, but just in case I also try to check it against existing worksheets, and this is where I am having the problem. I thought the following code would trigger the 'goto' on a 'subscript out of range' error (ie. the sheet doesn't exist), and then carry on:
However for some reason I am STILL getting the "Run-time error '9' Subscript out of range" box popping up when the code hits the line where I try to assign to temp_str.
I KNOW that the subscript SHOULD be out of range, but my error handler doesn't seem to be error handling very well...
Any ideas?
Thanks!
[EDIT] I should mention that this code is inside a 'For' loop, so will be repeated over and over if that makes a difference.
Bookmarks