PDA

View Full Version : EnableOutlining problem - It is driving me mad!!



3smees23
07-13-2012, 08:12 AM
Hi,

I'm trying to issue a new spreadsheet at work, however before I do I need to protect it. I have a couple of buttons that insert rows (they only work when you click the 'unhide crosshair' to the left).

When I protect my worksheet the crosshair and the buttons don't work!!

I have looked on the internet and realised that I could use the EnableOutlining function. However this still does not allow me the functionality I need.

I have the following code at the bottom of module1:

Private Sub Workbook_Open()
With Sheets("Take - Off")
.Unprotect Password:="sam"
.Protect Password:="sam", UserInterfaceOnly:=True
.EnableOutlining = True
End With
End Sub

Please can someone help, protecting a sheet should be so simple yet I'm here pulling my hair out.

Thanks

Sam

Kenneth Hobs
07-13-2012, 02:26 PM
Obviously, that does nothing. Put it in your ThisWorkbook object like your other routine.

3smees23
07-16-2012, 01:28 AM
I cut and pasted it in ThisWorkbook and I still lose functionality of the buttons and expansion crosshair....what am I doing wrong?

And for some reason when I open it now, a debug error appears!

If anyone can shed some light on this I would be really greatful.

Sam

snb
07-16-2012, 02:43 AM
Well, stepping through the code -F8- will help you find the error.

Aflatoon
07-16-2012, 04:22 AM
There are no spaces in the actual sheet name.

3smees23
07-16-2012, 04:25 AM
Thanks Guys, It kept adding in spaces. So I have just called it TakeOff and changed all references. Thanks again