Opening workbook automatically as Read-0nly

  • Thread starter Thread starter excelnut1954
  • Start date Start date
E

excelnut1954

I save a workbook to a public drive. It's a copy of a workbook I update
each night. I want folks here to bring up this workbook duing the day
to look up records. This is to be for view only. There will be multiple
users that will have this workbook open during the day.

Is there a way for the workbook to come up in Read-only mode, without
the message box telling you that the workbook is already open? They
would naturally accept the Read-Only mode from the message box. But, I
don't want there to be any confusion from users who don't normally use
Excel, or other programs where you can see this message. I also don't
want anyone clicking the "Notify..." button, either.

So, I'd like to save this file so that it will come up as read-only
without any message box.
Is this possible? I've looked in past posts, and don't see anything
dealing with this as a default setting.
Thanks,
J.O.
 
Excel respects the file attributes that you can set in Windows Explorer.

If you mark that file as ReadOnly using Windows Explorer, your users will not be
prompted when they open the workbook.
 
Excellent, Dave.
Thanks

Going 1 further. Someone leaves this workbook open all night. The
workbook is updated at the end of each day. Will there be any errors
saving to the same workbook name if it is still open?

Thanks again
J.O.
 
I think you'll have to test.

I worked ok when I did this:
Created a test workbook (book1.xls)
closed excel
used windows explorer to mark it readonly

reopened excel and that book1.xls (as readonly)
opened windows explorer and deleted the readonly file

Opened another instance of excel
created book1.xls
saved it
closed excel
used windows explorer to mark it readonly

The first instance of excel still was looking at the older/deleted version,
though.

I used winXP Home for my tests--and xl2003 (but I wouldn't guess that the
version of office played any role).

(I'm guessing that all versions of windows would react the same--but that's just
a wild guess.)
 
I appreaciate the info, Dave.

The read-only thing..... I see where you're talking about in Explorer.
Will I have to change this in Explorer manually each time? Sounds like
it. I was hoping to have code written in my end of day processing that
would take care of that. If not, then.... oh well. Not a huge thing
for this project.
Again, thanks for the help.

J.O.
 
As long as you do things in the correct order, you should be ok:

With ActiveWorkbook
.Save
SetAttr .FullName, vbReadOnly
End With

If you change it to readonly first, then try to save, you may have some trouble
<bg>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top