Wrkbk already open by whom?

A

ajliaks

Hi friends,

As some one told me here, Iam using "Error manipulation" to know whe
an specific workBk is already open, and works cool.

Question: Is there any way to know the Loggin name of the user usin
that workBk?

Thanks in advance,
Aldo.

This is the code to know if the file is already open:

Function CheckOrFileOpen(strFilename As String)
'This function checks to see if a file is open or not.
Dim intFile As Integer, intErrorNummer As Integer
On Error Resume Next
intFile = FreeFile()
' Attempt to open the file and lock it.
Open strFilename For Input Lock Read As #intFile
Close intFile
intErrorNummer = Err.Number
On Error GoTo 0
'Check to see which error occurred.
Select Case intErrorNummer
Case 0
CheckOrFileOpen = False
Case 70
CheckOrFileOpen = True
Case Else
Error intErrorNummer
End Select
End Functio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top