+ Reply to Thread
Results 1 to 2 of 2

error in attempt to warn about macro security

  1. #1
    Pierre via OfficeKB.com
    Guest

    error in attempt to warn about macro security

    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 OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...mming/200511/1

  2. #2
    Jim Thomlinson
    Guest

    RE: error in attempt to warn about macro security

    In any workbook there must be at least 1 visible sheet. You are trying to
    hide all of the sheets which will not work...
    --
    HTH...

    Jim Thomlinson


    "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 OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...mming/200511/1
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1