+ Reply to Thread
Results 1 to 1 of 1

Password protection with grouping causes error 1004

  1. #1
    Registered User
    Join Date
    05-12-2006
    Posts
    1

    Password protection with grouping causes error 1004

    Hi,

    I have the following macro in ThisWorkbook (suggested in another topic) to allow grouping and ungrouping in a password protected file.

    Sub WorkBook_Open()
    Application.ScreenUpdating = False
    Dim n As Single
    For n = 1 To Sheets.Count
    With Sheets(n)
    .Protect Password:="test", userinterfaceonly:=True
    .EnableOutlining = True
    .EnableAutoFilter = True
    End With
    Next n
    Application.ScreenUpdating = True
    End Sub

    When i apply it to an excel 2000 file it works perfectly. But when i want to open the file in excel 2003 it gives an error:

    Run-time error 1004: The password you supplied is not correct. Verify that the caps lock is off etc.etc.

    This starts with the worksheets that use grouping. The other sheets before that sheet (with no grouping) are all password protected with the correct password.

    Can anybody help? I'm new to macro's...

    Thanx!

    Michel
    Last edited by michelr; 05-12-2006 at 12:45 PM.

+ 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