ReadOnly Property

Microsoft Excel Visual Basic

Returns True if the object has been opened as read-only. Read-only Boolean.

This property is used only for lists that are linked to a SharePoint site.

expression.ReadOnly

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

If the active workbook is read-only, this example saves it as Newfile.xls.

If ActiveWorkbook.ReadOnly Then
    ActiveWorkbook.SaveAs fileName:="NEWFILE.XLS"
End If
		

The following example displays the setting of the ReadOnly property for the third column of a list in Sheet1 of the active workbook.

 
   Dim wrksht As Worksheet
   Dim objListCol As ListColumn
   
   Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
   Set objListCol = wrksht.ListObjects(1).ListColumns(3)

   Debug.Print objListCol.ListDataFormat.ReadOnly