hidden worksheet

C

colmkav

Please can someone answer this question I got at an interview?

What might be a reason why code to make a worksheet hidden might not
work?
 
G

Gord Dibben

The workbook is protected at Tools>Protection>Protect Workbook.


Gord Dibben MS Excel MVP
 
D

Dave Peterson

Here are a couple:

It'll fail if the workbook's structure is protected
(tools|Protection|protect workbook|check structure)

It'll fail if that's the only visible worksheet in the workbook.

The code tries to hide a worksheet by name and there is no worksheet by that
name (the user renamed/deleted it).
 
J

JMB

The code tries to hide a worksheet by name and there is no worksheet by that
name (the user renamed/deleted it).

Or the code is trying to select the hidden sheet in question in order to
hide it, but the sheet is already hidden (or does not exist or is otherwise
unavailable).

In any event, it's probably due to the user doing something you didn't think
any rationale person would attempt.
 
Top