Your code runs fine, the problem is you must have at least one visible sheet
in a file. Add a blank sheet first, then hide the rest. Exclude the token
visible sheet from your code.
HTH.
"Pierre via OfficeKB.com" wrote:
> Hi,
>
> I have the followign code .....
>
> Private Sub Workbook_Open()
> Dim Sheet As Worksheet
> For Each Sheet In Worksheets
> If Sheet.Name <> "waarschuwing" Then
> Sheet.Visible = xlSheetHidden
> End If
> Next Sheet
> Sheets("waarschuwing").Visible = xlSheetVeryHidden
> Set Sheet = Nothing
> end sub
>
> When the code is run, i get an error message:
>
> erro 1004
> characteristic visible of class worksheet cannot be use
>
> any ideas?
> Pierre
>
>
> --
> Message posted via http://www.officekb.com
>
Bookmarks