Password protect sheet and enable outlinig

cogswel__cogs

Board Regular
Joined
Jan 3, 2018
Messages
180
Hi,
I am trying to save a tab as a new sheet with password protection and outline enabled.
When I open the saved workbook, the tab is there and protected but the outline is not enabled.
Can anyone tell me what I am doing wrong.

Thanks for any help.


Sheets("Dem").Visible = True
Sheets("Dem").Copy

ActiveSheet.Protect Password:="astro", UserInterfaceOnly:=True
ActiveSheet.EnableOutlining = True


Application.ActiveWorkbook.SaveAs Filename:=xPath & "\Individual\" & v & z & "\" & VC & ".xlsx"
Application.ActiveWorkbook.Close False


End If
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
The UserInterfaceOnly:=True is needed for the outlining to work. Unfortunately it does not hold between sessions so when you close the workbook that setting is lost.
See here for a possible solution (which may or may not suit you)

BTW, I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Solution
That worked in theory.
However I need to now save the file as a xlms.
I am going to start another post on how I could do that.
Thanks for the help
 
Upvote 0
You're welcome. Sorry there isn't a simpler solution. :(
 
Upvote 0

Forum statistics

Threads
1,223,871
Messages
6,175,095
Members
452,612
Latest member
MESTeacher

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top