VBA : List user in Read Only file

Nyanko

Active Member
Joined
Sep 1, 2005
Messages
437
I'm using the following code to read and alert if the file is read only :

Code:
    Dim boolStatus As Boolean

    boolStatus = ActiveWorkbook.ReadOnly
    If boolStatus = False Then
        notesErr = "Warning this file is read only !" & vbCrLf
        notesErr = notesErr & "no information will be saved." & vbCrLf & vbCrLf
        notesbox = MsgBox(notesErr, vbCritical, "WARNING")
    End If

Is it possible to name and shame the person still in the file ? It appears in the standard warning (assuming you haven't bypassed such things) but is the variable available to be used ?

Many thanks
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I tried this in Excel 2007 and i get an overflow error on this line:

j = InStr(1, strXl, strflag2)
 
Last edited:
Upvote 0
The spreadsheet i'm trying to check is a 2007 Macro enabled spreadsheet (*.xlsm). It work fine on xls files but xlsm files return a bunch of binary garbage.
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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