Sheet("insertname here").Select throws runtime error

Kemidan2014

Board Regular
Joined
Apr 4, 2022
Messages
226
Office Version
  1. 365
Platform
  1. Windows
I am trying to troubleshoot a previous employees Macro powered Excel file that we as a group use alot.

I was able to get the password to the VBA Project to unlock it but for some reason a procedure we used religiously now throwing up a runtime error

1651592557646.png


The line of code it errors on is simply this
Sheets("Front Page").Select

i confirmed the Tab name and code line are the same

So why would it all of a sudden do this type of error on a simple Sheet select of an unprotected workbook?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
It's unusual to "Select" sheets, but anyway:
is the sheet visible? are you sure the sheet name is correct? have you tried running that specific line in the Immediate Window and if so, do you get the same error?
Try renaming the sheet (possible corruption).
Found a reference to enabling "AccessibilitycplAdmin 1.0 type admin" in Tools, Reference.. but I"m not sure what that library is or why it's needed.
 
Upvote 0
Solution
I did confirm sheet name to the reference are match by copy pasting the name
Your right theres better ways i am going to try at declare the sheets and set them and change all the sheets that are getting selected using declarations so they are being treated as objects to see if that works
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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