Forum

Run-time error '100...
 
Notifications
Clear all

Run-time error '1004': Unable to set the Visible Property of the Worksheet class - PLEASE HELP

4 Posts
2 Users
0 Reactions
2,062 Views
(@aylloh2011)
Posts: 9
Active Member
Topic starter
 

Hello,

I really need help with some of the VBA coding that I am attempting.  When I try to open my workbook and enter a User Name & Password, something is causing the error to display or hide certain sheets - at least that is what I gather from the description of the error.  I have been researching on many online resources and I can't figure out how to fix this error - or really why it's occurring.  The original workbook pages were not protected or hidden - so I am at a total loss as to how I can fix this. Confused

I will be forever grateful if someone can help me with a fix.

I have attached my report and the User Name and Password is:

User Name = James

Password = pw123

This is just something built for testing, so there is no confidential or real information here.  Please feel free to update and make changes if needed to test it.

Thank you in advance for the help! Smile

Annalisa

 
Posted : 24/09/2021 5:37 pm
(@debaser)
Posts: 838
Member Moderator
 

The Activate code in the form protects the workbook. That means that you can't then change the visibility of any sheet unless you unprotect the workbook again first.

 
Posted : 25/09/2021 3:29 am
(@aylloh2011)
Posts: 9
Active Member
Topic starter
 

I removed the line in the Activate code in the form, but nothing happens.  I don't get the error any longer, but no sheets appear.  The Login screen shows and stays but nothing else is happening.  Am I missing something else?

I have attached the updated file with the code line "ThisWorkbook.Protect 1234" removed

Please let me know.

Thanks!

Annalisa Smile

 
Posted : 25/09/2021 12:37 pm
(@debaser)
Posts: 838
Member Moderator
 

They are visible, just not active - you still have the front sheet selected which is entirely grey. Also, the sheet tabs have been hidden so there is no obvious way for the user to navigate in this workbook.

 
Posted : 28/09/2021 8:04 am
Share: