How to Detect if file is open "Read Only"

wyeah

Board Regular
Joined
Jun 23, 2003
Messages
92
Excel 2010 - Windows 7

I have a spreadsheet and in it is a formula that gives me the path and file name. I have the expected path and file name in a "hidden" cell. I have the cell where the formula is conditionally formatted to turn RED if it does not match the value in the "Hidden" cell. This work good if the 2 do not match. My problem is if the file is open as "Read Only" then the conditional formatting does not pick this up. Is there a way to make my conditional formatting turn the cell RED if the file is open as "Read Only" mode?

Thanks

Alan
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I don't beleive you will gain access the workbook properties without a UDF such as

Code:
Public Function IsReadOnly(wbname$)
    IsReadOnly = False
    On Error Resume Next
    Dim wb As Workbook
    Set wb = Workbooks(wbname$)
    If Not wb Is Nothing Then
        IsReadOnly = wb.ReadOnly
    Else
        IsReadOnly = "Workbook Not Found"
    End If


End Function

[\CODE]
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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