PC Review


Reply
Thread Tools Rate Thread

Detect if Excel file is "read only"???

 
 
Robert Crandal
Guest
Posts: n/a
 
      28th Feb 2010
If I open an Excel file which someone is currently using, Excel
will display a caption in the title bar that says "read only". Excel
is probably telling me that the file is read only because another
user currently is using the file.

My question is, does Excel have a function (or can I create
my own) which returns TRUE if the file is "read only" or
FALSE otherwise??? I'm mostly interested in a function
that returns TRUE if Excel displays the "read only" caption due
to the file's state of being in use.

thank you


 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      28th Feb 2010
if activeworkbook.ReadOnly = true then
'do something
else
'do something else
end if

--


Gary Keramidas
Excel 2003


"Robert Crandal" <(E-Mail Removed)> wrote in message
news:AJjin.1448$(E-Mail Removed)...
> If I open an Excel file which someone is currently using, Excel
> will display a caption in the title bar that says "read only". Excel
> is probably telling me that the file is read only because another
> user currently is using the file.
>
> My question is, does Excel have a function (or can I create
> my own) which returns TRUE if the file is "read only" or
> FALSE otherwise??? I'm mostly interested in a function
> that returns TRUE if Excel displays the "read only" caption due
> to the file's state of being in use.
>
> thank you
>
>


 
Reply With Quote
 
Barb Reinhardt
Guest
Posts: n/a
 
      28th Feb 2010
I've put something in the "Workbook_Open" procedure in the "ThisWorkbook"
module to check to see if the workbook is read only. The only difference
is that I'd use
If ThisWorkbook.Readonly then
'Do something
Else
'Do something else
end if

That way you know immediately when you open the workbook that it's read
only. Of course, macros need to be enabled for this to work.
--
HTH,

Barb Reinhardt



"Robert Crandal" wrote:

> If I open an Excel file which someone is currently using, Excel
> will display a caption in the title bar that says "read only". Excel
> is probably telling me that the file is read only because another
> user currently is using the file.
>
> My question is, does Excel have a function (or can I create
> my own) which returns TRUE if the file is "read only" or
> FALSE otherwise??? I'm mostly interested in a function
> that returns TRUE if Excel displays the "read only" caption due
> to the file's state of being in use.
>
> thank you
>
>
> .
>

 
Reply With Quote
 
Bill McMurray
Guest
Posts: n/a
 
      28th Feb 2010
Robert,

I am just an old, gray-haired teacher. A very useful lesson for my
students is to learn self-instruction and not rely on others if it is not
necessary. In other words, it would behoove them to research information
themselves. It can be a powerful tool, especially today in the age of the
internet.

I have not responded before in this NG but I do frequent the threads so I
may learn more. What I have noticed with many of your questions is that the
answers are right at *your* fingertips but you rely on others to provide
them for you.

In this case, if you simply searched VBA help for "readonly", you would have
found "workbook.readonly property" which is exactly what Mr. Keramidas
provided you with. You could have had your answer in a matter of seconds
instead of minutes.

In addition, a Google search for
http://www.google.com/search?hl=en&s...&aqi=&aql=&oq=
resulted in the first hit http://support.microsoft.com/kb/153058

I hope you accept this advice (from a teacher of 42 years) in the manner
intended.

Bill

"Robert Crandal" <(E-Mail Removed)> wrote in message
news:AJjin.1448$(E-Mail Removed)...
> If I open an Excel file which someone is currently using, Excel
> will display a caption in the title bar that says "read only". Excel
> is probably telling me that the file is read only because another
> user currently is using the file.
>
> My question is, does Excel have a function (or can I create
> my own) which returns TRUE if the file is "read only" or
> FALSE otherwise??? I'm mostly interested in a function
> that returns TRUE if Excel displays the "read only" caption due
> to the file's state of being in use.
>
> thank you
>
>
>


 
Reply With Quote
 
Robert Crandal
Guest
Posts: n/a
 
      28th Feb 2010
Hi Bill,

But, if nobody relied on you and merely used Google for
their information, then you would be out of a teaching job,
wouldn't you??

I'm just being a smart ass here, haha. No offense is intended
to ya! Thanks for the advice though.

Robert


"Bill McMurray" <(E-Mail Removed)> wrote in message
news:553A359B-E491-4149-8EA5-(E-Mail Removed)...
> Robert,
>
> I am just an old, gray-haired teacher. A very useful lesson for my
> students is to learn self-instruction and not rely on others if it is not
> necessary. In other words, it would behoove them to research information
> themselves. It can be a powerful tool, especially today in the age of the
> internet.
>
> I have not responded before in this NG but I do frequent the threads so I
> may learn more. What I have noticed with many of your questions is that
> the answers are right at *your* fingertips but you rely on others to
> provide them for you.
>
> In this case, if you simply searched VBA help for "readonly", you would
> have found "workbook.readonly property" which is exactly what Mr.
> Keramidas provided you with. You could have had your answer in a matter
> of seconds instead of minutes.
>
> In addition, a Google search for
> http://www.google.com/search?hl=en&s...&aqi=&aql=&oq=
> resulted in the first hit http://support.microsoft.com/kb/153058
>
> I hope you accept this advice (from a teacher of 42 years) in the manner
> intended.
>


 
Reply With Quote
 
Bill McMurray
Guest
Posts: n/a
 
      28th Feb 2010
Robert,

You're alright in my books.

The good news for teachers is that there are just some things you *can't*
learn through the internet.

Cheers from an old dinosaur.

Bill

"Robert Crandal" <(E-Mail Removed)> wrote in message
news:R_kin.30088$(E-Mail Removed)...
> Hi Bill,
>
> But, if nobody relied on you and merely used Google for
> their information, then you would be out of a teaching job,
> wouldn't you??
>
> I'm just being a smart ass here, haha. No offense is intended
> to ya! Thanks for the advice though.
>
> Robert
>
>
> "Bill McMurray" <(E-Mail Removed)> wrote in message
> news:553A359B-E491-4149-8EA5-(E-Mail Removed)...
>> Robert,
>>
>> I am just an old, gray-haired teacher. A very useful lesson for my
>> students is to learn self-instruction and not rely on others if it is not
>> necessary. In other words, it would behoove them to research information
>> themselves. It can be a powerful tool, especially today in the age of
>> the internet.
>>
>> I have not responded before in this NG but I do frequent the threads so I
>> may learn more. What I have noticed with many of your questions is that
>> the answers are right at *your* fingertips but you rely on others to
>> provide them for you.
>>
>> In this case, if you simply searched VBA help for "readonly", you would
>> have found "workbook.readonly property" which is exactly what Mr.
>> Keramidas provided you with. You could have had your answer in a matter
>> of seconds instead of minutes.
>>
>> In addition, a Google search for
>> http://www.google.com/search?hl=en&s...&aqi=&aql=&oq=
>> resulted in the first hit http://support.microsoft.com/kb/153058
>>
>> I hope you accept this advice (from a teacher of 42 years) in the manner
>> intended.
>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Cannot access read-only document" (I get this error when I try to open an Excel file) jimj122680@yahoo.com Microsoft Excel Misc 1 5th Jun 2006 01:15 PM
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. Tim Marsden Microsoft Excel Charting 2 15th Oct 2005 02:10 PM
"Unable to read file" error message when you open Excel file that contains a PivotTable report Tim Marsden Microsoft Excel Discussion 0 12th Oct 2005 04:38 PM
Error boxes when opening Excel "unable to read file" then "open X. =?Utf-8?B?anBweg==?= Microsoft Excel Setup 1 19th Feb 2005 03:51 AM
"Unable to read file" after Excel crash - how to recover the file?? Hudec, Martin [CHOD:4759:EXCH] Microsoft Excel Crashes 0 18th Jul 2003 08:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 AM.