Crash when using 'Sheets("Sheet").Activate'

  • Thread starter Thread starter Mikey May
  • Start date Start date
M

Mikey May

When I am using the 'Sheets("Sheetname").Activate' Command
my Excel session is crashing. What is odd is that I have
this code in other parts of the same macro and other
macro's and it works fine. Also another strange things is
that while testing these macro's there was no crash.

If I take the offending code out the macro will work OK,
but I do need this code in there.

HELP!!!!!
 
Do you mean your code is causing an error or do you really mean that excel is
crashing (and closing)?

If it's just causing an error, you may want to check to see that "sheetname" is
really where you expect it.

If it's causing excel to terminate, then I'd try your code against a new test
workbook. Maybe something worse is going on. If it works ok in that test
workbook, then maybe recreate that "sheetname" worksheet to see if that was the
problem.

And a simple thing to try is cleaning your code using Rob Bovey's codecleaner
program.

You can find it at:
http://www.appspro.com/
 
Back
Top