Open File with VBA

G

Guest

Hello everyone-

I have a code that opens an existing excel file but, if someone is already
in the file, it does not pop up a window that says which user is currently in
the file. Can some add to my coding so that when the file is opened and
someone is in the file it will identify who is in the file? Thanks.

Sub Open_Wiresheet()

Dim objExcel As Object
Dim SchedWkbk As Workbook


On Error Resume Next
Set SchedWkbk = Nothing

Set objExcel = CreateObject("Excel.Application")


Set SchedWkbk = objExcel.Application.Workbooks.Open _
("O:\SEM\Common\Accounting\May-07 Wire Transfer Schedule.xls
") ' WIRE TRXFER FILE
objExcel.Visible = True
On Error Resume Next


If SchedWkbk Is Nothing Then
Msgbox prompt:="Cannot find file. Please open file manually", _
Buttons:=vbOKOnly + vbQuestion

End If

End Sub
 
G

Guest

do u have a macro that will identify who is currently in the file if I am
trying to access it? Thanks.
 

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