Article ID: 178986
Article Last Modified on 6/17/2005
EnableAutoFilter
EnableCalculation
EnableOutlining
DisplayPageBreaks
EnablePivotTable
EnableSelection
' Auto_Open macros run automatically when you open the workbook.
Sub Auto_Open()
With ThisWorkbook.Worksheets("Sheet1")
' Set as many of these properties as you need.
.EnableSelection = xlNoSelection
.EnablePivotTable = True
.EnableOutlining = True
.EnableAutoFilter = True
.DisplayPageBreaks = True
.EnableCalculation = False
End With
End Sub
If you insert this code into a module in the workbook, the macro sets the
properties for worksheet Sheet1 whenever you open the workbook manually.
Property Default Value ---------------------------------------- EnableSelection 0 - xlNoRestrictions EnableOutlining False EnableAutoFilter False EnablePivotTable False EnableCalculation True DisplayPageBreaks FalseYou can set these properties programmatically, as in the "Workaround" section in this article, or you can use the Properties window in the Visual Basic Editor to set them. To do this, follow these steps:
Additional query words: XL98 xlunlockedcells
Keywords: kbui kbprb kbcode KB178986