For example: The following statement will open an Excel
workbooked called 'Test.xls', but how to I tell is it is
openned by another user?
Workbooks.Open FileName:="Test.xls"
See if this does what you want:
Sub test()
Dim wbk As Workbook
Set wbk = Workbooks.Open("C:\temp\book1.xls")
If wbk.ReadOnly Then
MsgBox "Write reserved by " & _
wbk.WriteReservedBy
End If
End Sub
HTH. Best wishes Harald
"Dale Anson" <dan...@telec-consulting.com> wrote in message
news:1f5801c273bc$753700a0$36ef2ecf@tkmsftngxa12...
You can use the following VBA statements to test if the active workbook is
read-only.
If ActiveWorkbook.ReadOnly Then
' Execute your code here
End If
Regards,
Brian Small
________________________________
"Dale Anson" <dan...@telec-consulting.com> wrote in message
news:1f5801c273bc$753700a0$36ef2ecf@tkmsftngxa12...
If you open it up ReadOnly you can check the .WriteReservedBy property.
See below link for more details - you'll have to piece it together though.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=%23DgWdh
NYCHA.2564%40tkmsftngp09&rnum=1&prev=/groups%3Fq%3Dworkbook%2B%2Bopen%2Buser
name%2Bogilvy%2Bgroup:microsoft.public.excel.programming%26num%3D100%26hl%3D
en%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26scoring%3Dd
HTH,
Gareth
"Dale Anson" <dan...@telec-consulting.com> wrote in message
news:1f5801c273bc$753700a0$36ef2ecf@tkmsftngxa12...