Anybody familiar with a bug where tab names become invisible to VBA only?

Gingaskunk

New Member
Joined
Jun 2, 2020
Messages
5
Office Version
  1. 365
Platform
  1. 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.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
The thinks I would look for is: what was the VBA doing just before this line and which sheet was active? Was there any chance that the previous instruction hadn't completed before the Active was executed. Also have you tried using a different name to "MySheet".
Just ideas to try and help.
 
Upvote 0
The thinks I would look for is: what was the VBA doing just before this line and which sheet was active? Was there any chance that the previous instruction hadn't completed before the Active was executed. Also have you tried using a different name to "MySheet".
Just ideas to try and help.

Appreciate the reply. It happened in a couple of different sheets over the course of the week and doing the "copy / paste the tab dance" fixed it, which indicates to me that the prior code was not what was getting hung up. Additionally, querying the sheet in the immediate window returned an error before the copypasting, and returned the sheet name after.

This impacted about 4 different tabs in the book. I didn't specifically try renaming the sheet and its reference in the code, I can try that next time, although even if it works, I'm not sure what new information this gives us.

Thank you for your input though.
 
Upvote 0

Forum statistics

Threads
1,215,754
Messages
6,126,681
Members
449,328
Latest member
easperhe29

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top