+ Reply to Thread
Results 1 to 5 of 5

Macro to set opened workbook Read Only

  1. #1
    Registered User
    Join Date
    01-15-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Macro to set opened workbook Read Only

    Hello, how do I set the read only attribute when opening a file? Please see the code below (does not currently work). Thank you.

    Please Login or Register  to view this content.
    Last edited by Dora; 01-15-2009 at 09:43 PM.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    You could save it password-protected in order to modify it.

    File > Save As > Tools > General Options, then assign a password in the Password to Modify field.

    HTH

    Jason

  3. #3
    Registered User
    Join Date
    01-15-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5
    Hello, this is Excel 2003. I want users to be able to modify the file, but to save it as a different name, that's what it needs to be read-only. I cannot set the read-only property as an attribute on the file level, but have to use a macro, because when I right-click/properties and select read-only, that read-only is not retained if I email the file to users. Once they get it in email and they save it in their location, it's not longer read-only. That's why it needs to be forced by a macro.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Wouldn't it be simpler to set the ReadOnly status manually? if you rly on code then it won't work unless the user enables macros.

    In an case you cannot set the rad only property like that, you ned to use
    Please Login or Register  to view this content.
    Last edited by royUK; 01-16-2009 at 02:56 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    If you follow the steps I indicated above (it applies to Excel 2003), it will always open the file as read-only unless you enter the correct password. There is no need to use VBA to do this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1