Ok, so my first question is pretty easily sorted by checking activeworkbook.readonly status.
Please anybody got any advice on how I can find out who has write access to the file?
Orson.
Ok, so my first question is pretty easily sorted by checking activeworkbook.readonly status.
Please anybody got any advice on how I can find out who has write access to the file?
Orson.
Good evening Orson100
I saw your post earlier, and as I don't have Excel 2010 I'm probably not the best person to answer, but ...
Ivan F Moala has a couple of routines here that should help out. However, he gives two options to do it ; a VBA method and an API method. With Excel 2010 you would need to avoid the API method - I won't go into why, I'll just tell you now it almost certainly won't work. There should be no reason why the VBA method would fail.
HTH
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Dominic,
Thanks for the references. However, due to a particularly bad episode of brain freeze on my part, this is all redundant.
In addition to migrating from XL07 to XL10 I am also porting to a new server environment and guess what.. I forgot to set write permissions for the usersSo my belief that the "this file is locked for editing by [etc]" message had been dropped in XL10 is completely wrong, File access was defaulting straight to R/O mode by virtue of the permissions at server level only. The message is still there.
Sorry all for this confusion.
By the time I had realised this, I had already cobbled together a wheel re-invention from various sources as below, which might be useful if one wishes to re-display the current (or more correctly, last-known) write-access user details during an active Excel session or something I don't know...
Sorry again for the incorrect steer and thanks for the advice.
Regards
Orson.
![]()
Private Sub Workbook_Open() 'Wheel Re-invention 'If workbook is opened in write mode, save the current 'user data to a sheet in the workbook If ActiveWorkbook.ReadOnly = False Then Users = ActiveWorkbook.UserStatus With Sheets("User") For Row = 1 To UBound(Users, 1) .Cells(Row, 1) = Users(Row, 1) .Cells(Row, 2) = Users(Row, 2) Next End With ' For the benefit of the next person to access, the ' current user data on sheet User must be saved to workbook file ActiveWorkbook.Save End If 'If workbook is opened in readonly mode, display the user who has 'current write access (include date and time of access if desired @ user!b2 ) If ActiveWorkbook.ReadOnly = True Then MsgBox "You are in Read Only Mode. This Workbook is being edited by " _ & Sheets("User").Range("a1") End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks