ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
Hey guys
Can anyone point me to an article or post regarding random breaks of code? I'm talking really random - as in they've worked fine for ages, don't require anything from a Reference or Object library that no longer exists, but one day, they just stop working?
I had a macro that for months was working fine every day. It was simply adding checkboxes to a 'myrange' type area set by lastrows.
It did this in a loop through 8 sheets - and one day, 1 particular sheet stopped working - and gave application-defined or object-defined errors. I know it to be just that sheet - because all the others worked fine, and it always crashed when it got to that sheet - which is identical I might add to all the others bar a title at the top (and not even in the same column as where the checkboxes were going)
How did I fix it? I deleted the worksheet, remade it, and suddenly it works Fine!!!!
AND NOW... today, a really simple line just stopped working - again giving the 'application defined or object defined error'.
The line was
This has worked fine for a long time. I double checked the named ranges, they're all fine. I tried typing them in the cell_ref box, and it took me straight to the range.
I found an exact copy of the workbook from 3 weeks ago, and the same code in that workbook works fine!!!
So why is it that sometimes excel will just 'break'?
Has anyone else ever had this same problem?
Sometimes I'd find that something wouldn't work, I'd go home, come back in the next day, and the code would work again!
This is excel2003 I might add.
Can anyone point me to an article or post regarding random breaks of code? I'm talking really random - as in they've worked fine for ages, don't require anything from a Reference or Object library that no longer exists, but one day, they just stop working?
I had a macro that for months was working fine every day. It was simply adding checkboxes to a 'myrange' type area set by lastrows.
It did this in a loop through 8 sheets - and one day, 1 particular sheet stopped working - and gave application-defined or object-defined errors. I know it to be just that sheet - because all the others worked fine, and it always crashed when it got to that sheet - which is identical I might add to all the others bar a title at the top (and not even in the same column as where the checkboxes were going)
How did I fix it? I deleted the worksheet, remade it, and suddenly it works Fine!!!!
AND NOW... today, a really simple line just stopped working - again giving the 'application defined or object defined error'.
The line was
Rich (BB code):
ActiveWorkbook.Names(Sheets("Tools").Range("G5").Value).RefersToRange.Copy
Worksheets("CustomReport").Range("B3").PasteSpecial xlPasteValuesAndNumberFormats
This has worked fine for a long time. I double checked the named ranges, they're all fine. I tried typing them in the cell_ref box, and it took me straight to the range.
I found an exact copy of the workbook from 3 weeks ago, and the same code in that workbook works fine!!!
So why is it that sometimes excel will just 'break'?
Has anyone else ever had this same problem?
Sometimes I'd find that something wouldn't work, I'd go home, come back in the next day, and the code would work again!
This is excel2003 I might add.