Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Detect if Excel file is "read only"???

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Detect if Excel file is "read only"???

if activeworkbook.ReadOnly = true then
'do something
else
'do something else
end if

--


Gary Keramidas
Excel 2003


"Robert Crandal" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Detect if Excel file is "read only"???

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


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Detect if Excel file is "read only"???

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...qi =&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" wrote in message
...
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Detect if Excel file is "read only"???

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" wrote in message
...
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...qi =&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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Detect if Excel file is "read only"???

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" wrote in message
...
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" wrote in message
...
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...qi =&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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Unable to Read File" error message in Excel - solutions? Presby Loaner Excel Discussion (Misc queries) 2 June 27th 07 05:09 PM
"Cannot access read-only document" (I get this error when I try to open an Excel file) [email protected] Excel Discussion (Misc queries) 1 June 5th 06 01:15 PM
"Cannot access read-only document" (I get this error when I try to open an Excel file) [email protected] Setting up and Configuration of Excel 1 June 5th 06 01:15 PM
Excel 2002/2003 can not open xls file says "may be read only" Number6 Excel Discussion (Misc queries) 3 December 20th 05 05:25 PM


All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"