+ Reply to Thread
Results 1 to 3 of 3

Force "Read Only" only in original spreadsheet - NOT in resultant "saved as" spreadsheets

  1. #1
    Registered User
    Join Date
    03-24-2016
    Location
    Washington, DC
    MS-Off Ver
    2010
    Posts
    41

    Force "Read Only" only in original spreadsheet - NOT in resultant "saved as" spreadsheets

    I have 1 template that I don't want a variety of users to save on top of. I want people to be able to use it to generate reports but keep it blank, saving their own results in a separate document.

    Therefore, I forced "Read Only" when people open the spreadsheet using this VB code:
    Please Login or Register  to view this content.
    I'm running into 2 issues:
    1. After someone hits "Save As" and it becomes another document, later on that new document also becomes Read Only and I don't want this. Is there some way to reference the specific name of the original report template document so that it's only read only if the file name is that original document name?
    2. Users are supposed to copy/paste information from another workbook. Whenever I toggle across workbooks in the same instance of Excel, selecting my Read Only reports template workbook, I get "Run-time error '1004': Method 'ChangeFileAccess' of object '_Workbook' failed".

    Any thoughts? Thanks so much in advance!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Force "Read Only" only in original spreadsheet - NOT in resultant "saved as" spreadshe

    Re 1.

    Untested but try

    Please Login or Register  to view this content.
    Re 2. Does this also happen if you select a non template file?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-24-2016
    Location
    Washington, DC
    MS-Off Ver
    2010
    Posts
    41

    Re: Force "Read Only" only in original spreadsheet - NOT in resultant "saved as" spreadshe

    EDIT: Never mind! This code does work for read only for just the original file. I figured out what it was - it was the . instead of the comma. Thank you!!!
    Please Login or Register  to view this content.
    I'm not sure what's causing the other error message. Really, if I could just ignore the error message everything else seems to be working fine.

    I really appreciate your help!
    Last edited by xdrenched; 04-21-2016 at 01:19 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] "Read" the column header "Element" and perform calculation
    By dwsf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2015, 01:41 AM
  2. [SOLVED] Script to save to folder in "v:\dept2", confirm file saved, then delete from "v:\dept1"
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2014, 11:42 AM
  3. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  4. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  5. Replies: 4
    Last Post: 04-27-2013, 01:23 AM
  6. MSoffice Outlook 2003 message to be saved in C dir with the file name "From" "Sent" "Sub"
    By shailendra0509 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2012, 01:32 AM
  7. Replies: 0
    Last Post: 08-07-2006, 01:35 AM

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