Allow comments in protected sheet using VB

C

CraigKer

I am using VB to protect a sheet in an excel workbook. Because I use
grouping/outlining within the sheet I have to use VB to protect the sheet.
However, when I protect the sheet I cannot add comments to the unlocked
cells. If I was not using VB to protect I would "allow users to edit
objects" when protecting the sheet and then comments could be added. How can
I fix this in VB?
 
D

Dave Peterson

Include that option (to edit objects) in the code that protects the worksheet.

I'm not sure I understand why protecting the sheet in code would make a
difference.
 
C

CraigKer

I don't know what that option to (to edit objects) is? It's not an option
for the protect method that I am using. My code to protect the sheet is as
follows:

With Worksheets("Sheet1")
.Protect Password:="XXXXXX", userinterfaceonly:=True,
AllowFormattingCells:=True, AllowFormattingColumns:=True,
AllowInsertingRows:=True, AllowSorting:=True,
AllowFormattingRows:=True
.enableoutlining = True
.EnableAutoFilter = True
If FilterMode Then
.ShowAllData
End If
.EnableSelection = xlNoRestrictions
End With
 
D

Dave Peterson

Record a macro when you do it twice--once with the option chosen and once
exactly the same, but with that option unchecked. Then you can look at each and
see the difference.

(In a hushed voice--look for drawingobjects)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top