View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default Check if an Excel or Word file is "read only"????

Hi Robert

Sub test()
MsgBox ActiveWorkbook.ReadOnly
MsgBox ActiveWorkbook.WriteReserved
MsgBox ActiveWorkbook.WriteReservedBy
End Sub

This needs the file to be open. If you want to see if a file is in use
before opening it, there is usually a similarly named temp file in the same
folder if someone else uses the file. Test opening and closing with a file
explorer window open.

Best wishes Harald

"Robert Crandal" wrote in message
...
Are there any VBA functions I can call from an Excel file that
will help me determine if a particular Excel 2007 or Word 2007
is currently in "read only" status? In other words, I need to
test if an Excel or Word file is opened or in use by another user??

I would like to know any or all methods to achieve this.

Thank you everyone!

Robert