Gingaskunk
New Member
- Joined
- Jun 2, 2020
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hey guys,
So we've had this happen a couple of times the last week and I'm not sure what the cause is. I'm wondering if any of you have seen it before?
Simply put, a sheet is activated in VBA, e.g. "Worksheets("MySheet").Activate" and the code stops with an exception as if that tab didn't exist.
However, the sheet remains entirely unchanged from when it ran successfully the day before. The tab , "MySheet" is still there, still visible, still named the same. I copied the tab name directly from the tab itself and pasted it into the VBA to ensure there's no issue with spelling, unicode etc, but no go, same error.
Eventually I fixed it but right-clicking the tab and selecting, "make a copy". Then I deleted the old tab entirely and renamed the copy of the tab to the original tab's name. This worked. A copy of that EXACT tab ran fine through the code...
It's the weirdest thing so I figured I'd throw it out there and see if anyone else has any experience with this. Any idea what triggers it to happen, or how to fix it without chasing broken tabs and copy-pasting?
Many thanks.
So we've had this happen a couple of times the last week and I'm not sure what the cause is. I'm wondering if any of you have seen it before?
Simply put, a sheet is activated in VBA, e.g. "Worksheets("MySheet").Activate" and the code stops with an exception as if that tab didn't exist.
However, the sheet remains entirely unchanged from when it ran successfully the day before. The tab , "MySheet" is still there, still visible, still named the same. I copied the tab name directly from the tab itself and pasted it into the VBA to ensure there's no issue with spelling, unicode etc, but no go, same error.
Eventually I fixed it but right-clicking the tab and selecting, "make a copy". Then I deleted the old tab entirely and renamed the copy of the tab to the original tab's name. This worked. A copy of that EXACT tab ran fine through the code...
It's the weirdest thing so I figured I'd throw it out there and see if anyone else has any experience with this. Any idea what triggers it to happen, or how to fix it without chasing broken tabs and copy-pasting?
Many thanks.