Thread: Errors in 2007
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Errors in 2007

That error 9 (Subscript out of range) usually shows up when you refer to
something that doesn't exist.

Like:
worksheets("sheet999").cells.clear
if there was no sheet named 999 in the activeworkbook.

I wouldn't ignore the problem. But I would try to isolate the lines causing the
trouble (maybe step through the code???).

I wouldn't think of it as ripping apart your code--more like a surgical strike.


QB wrote:

I developed an Excel Workbook that has VBA to automate certain processes. It
works without any issue in 2003.

Now we have moved to 2007 and for an unknown reason the code now spits out
'error: 9', several times.

The code still run and the result is correct?! Should I simply ignore the
error statements or should they be adressed?

Is this a known issue by any chance or do I need to rip apart my code to
resolve it?

Thank you for your advice,

QB


--

Dave Peterson