This one is a bit easier to understand:
Dim location As String
Dim wbk As Workbook
location = "c:\excel.xls"
Set wbk = Workbooks.Open(location)
'Check to see if file is already open
If wbk.ReadOnly Then
ActiveWorkbook.Close
MsgBox "Cannot update the excelsheet, someone currently using file. Please try again later."
Exit Sub
End If