-
Knowledge Base Approver
The King of Overkill!
VBAX Master
Mr Rhodes,
[vba]Sub ShowWhoLockedIt()
Dim i As Long, j As Long, tStr As String
With ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
tStr = .Lines(1, .CountOfLines)
End With
i = InStr(1, tStr, "application.username = """, vbTextCompare) + 24
j = InStr(i, tStr, """", vbTextCompare)
MsgBox Mid(tStr, i, j - i)
End Sub[/vba]Matt
EDIT: You may want to consider using something other than 'Application.UserName', as that can be set by the user and they could change theirs to match yours and get into the file. See http://vbaexpress.com/kb/getarticle.php?kb_id=768 for your options
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules