Today I started to get errors from an Excel workbook containing macros; until now it has ben working nicely. I could narrow down the problem to a line containing ActiveSheet.CodeName.
Even when I run a very simple macro like
Sub tst() MsgBox ActiveSheet.Codename End Sub
or just type in the Immediate window
this works on some activated worksheets, while after activating other sheets of the same workbook (of course a single sheet each time) I get:
Run-time error '32809', Application-defined or object-defined error.
This is the case with different variations like
Activeworkbook.xxx works well.
I work with Excel 2010, VBA 7.0, Windows 7.