I've been given an ancient but, for the most part, working Excel solution. It uses a lot of DialogSheets (an Excel 5/95 technique before UserForms).
Now I'm trying to figure out what the author tried to do, the code is pretty horrible. One problem I stumbled across is this:
Some sheets work fine with code like:
DialogSheets("Name1").Show
DialogSheets("Name1").Labels.Visible = True
DialogSheets("Name1").EditBoxes.Visible = True
DialogSheets("Name1").CheckBoxes.Visible = True
DialogSheets("Name1").DropDowns.Visible = True
On others, I get a:
runtime error 1004 "Unable to set the Visible property of the Labels class"
I cannot quite work out the difference, and the documentation on Dialogsheets is pretty sparse. If anyone had any idea I'd appreciate a suggestion.
Update
The answers suggest that some DialogSheets may not have Labels, thus throwing the 1004. This is not the case. This happens in the ImmediateWindow:
?DialogSheets("Name1").Labels.Count
205
?DialogSheets("Name2").Labels.Count
7
DialogSheets("Name1").Labels.Visible = True ' Throws 1004
DialogSheets("Name2").Labels.Visible = True ' executes fine
?DialogSheets("Name2").Labels.Visible = True ' returns true
True