Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if an Excel or Word file is "read only"????
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if an Excel or Word file is "read only"????
Do you know how to check the read only status on a
file that is NOT the ActiveWorkbook? For example, I will be using a file named "mydata.xlsm". While using this file, I want to run a macro to test whether a file named "groupdata.xlsm" is open or being used by another user. Also, if I want to see if a file is in use BEFORE opening it, does that mean I need to check for the presence of a hidden temp file in the same folder with a similar name? Is there a reliable VBA function for this? Thank you Harald! "Harald Staff" wrote in message . .. 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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if an Excel or Word file is "read only"????
On 07/08/2010 13:24, Robert Crandal wrote:
Might be worth looking at: http://www.vbaexpress.com/kb/getarticle.php?kb_id=468 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if an Excel or Word file is "read only"????
MsgBox Workbooks("mydata.xlsm").ReadOnly 'and so on and Yes, and No, not to my knowledge, you must write it. Best wishes Harald "Robert Crandal" wrote in message ... Do you know how to check the read only status on a file that is NOT the ActiveWorkbook? For example, I will be using a file named "mydata.xlsm". While using this file, I want to run a macro to test whether a file named "groupdata.xlsm" is open or being used by another user. Also, if I want to see if a file is in use BEFORE opening it, does that mean I need to check for the presence of a hidden temp file in the same folder with a similar name? Is there a reliable VBA function for this? Thank you Harald! "Harald Staff" wrote in message . .. 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. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if an Excel or Word file is "read only"????
On 8/7/2010 7:31 AM, Harald Staff wrote:
MsgBox Workbooks("mydata.xlsm").ReadOnly 'and so on and Yes, and No, not to my knowledge, you must write it. Best wishes Harald "Robert Crandal" wrote in message ... Do you know how to check the read only status on a file that is NOT the ActiveWorkbook? For example, I will be using a file named "mydata.xlsm". While using this file, I want to run a macro to test whether a file named "groupdata.xlsm" is open or being used by another user. Also, if I want to see if a file is in use BEFORE opening it, does that mean I need to check for the presence of a hidden temp file in the same folder with a similar name? Is there a reliable VBA function for this? Thank you Harald! "Harald Staff" wrote in message . .. 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. How about this approach? http://support.microsoft.com/kb/153058 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check if cells contain the word "Thailand", return "TRUE" | Excel Worksheet Functions | |||
"Unable to Read File" error message in Excel - solutions? | Excel Discussion (Misc queries) | |||
"Cannot access read-only document" (I get this error when I try to open an Excel file) | Excel Discussion (Misc queries) | |||
"Cannot access read-only document" (I get this error when I try to open an Excel file) | Setting up and Configuration of Excel |