This workbook has lost its VBA project, ActiveX controls and any other programmability-related features.

inosent

Board Regular
Joined
Mar 19, 2007
Messages
131
i have VBA installed, working, etc, but i still get this message

i am trying to unhide worksheets using VBA
Code:
Sub UnhideAllSheets()
    Dim wsSheet As Worksheet

    For Each wsSheet In ActiveWorkbook.Worksheets
        wsSheet.Visible = xlSheetVisible
    Next wsSheet
End Sub

but it gets stuck here: wsSheet.Visible = xlSheetVisible
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Is this procedure being called from an event handler such as Workbook_BeforeSave or Workbook_BeforeClose, or is it being called from a procedure where the workbook has been saved?
 
Upvote 0
i created a module, paste the code, hit run and got an error

not sure how else to put it ...

thanks for the reply
 
Upvote 0
If you save and close the workbook, reopen it, add a new code module and copy+paste in the code and then run it by pressing F8 to step through the code, do you get the same error on that line? If yes, is it on the first iteration on the loop or is it a subsequent sheet that is causing the problem?
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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