Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Protection and Enable Outlining

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vlado Sveda - 25 Jan 2006 07:32 GMT
Hi Gurus !

I have (successfully) used in my code (7-8 month ago) :

Private Sub Workbook_Open()
   
   Dim Sh As Worksheet

   For Each Sh In ActiveWorkbook.Sheets
       Sh.EnableOutlining = True
   Next Sh

End Sub

... but now it doesn't work ;-(

Could you please help me ? What am I doing wrong ?
I have Office 2002, SP3 (from About Microsoft Excel window)

Thank you for your answers in advance !
Crowbar - 25 Jan 2006 14:43 GMT
I have had this same problem this week, that is if the error is'1004' range
or class method

I inserted  

sheets("yoursheetname").select

I know it seems simply but it fixed it mine!
Dave Peterson - 25 Jan 2006 15:19 GMT
I think I'd specify the password, too:

Option Explicit
Private Sub Workbook_Open()
   With Worksheets("sheet1")
       .Protect Password:="hi", userinterfaceonly:=True
       .EnableOutlining = True
   End With
End Sub

If the passwords for all the sheets are the same, you could just loop through
the sheets.  If the passwords are different, you'll need to account for this,
too.

> Hi Gurus !
>
[quoted text clipped - 16 lines]
>
> Thank you for your answers in advance !

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.