Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Password protection with grouping causes error 1004


Hi,

I have the followiing macro in ThisWorkbook (suggested in anothe
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
want to open the file in excel 2003 it gives an error:

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

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

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

Thanx!

Miche

--
michel
-----------------------------------------------------------------------
michelr's Profile: http://www.excelforum.com/member.php...fo&userid=3437
View this thread: http://www.excelforum.com/showthread.php?threadid=54148

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error 1004 while conditionally hiding rows as a result ofworksheet protection ran58 Excel Discussion (Misc queries) 2 July 22nd 09 07:42 AM
Error when save as CSV with VBA password protection on [email protected] Excel Discussion (Misc queries) 0 August 1st 06 10:50 PM
HELP! Get error while saving after password protection monica Excel Programming 2 December 15th 05 09:30 PM
Run-Time 1004 password error Bob Excel Discussion (Misc queries) 1 July 25th 05 10:23 PM
Error Trap for bypassing Password Protection Arawn Excel Programming 0 June 4th 04 11:21 PM


All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"