+ Reply to Thread
Results 1 to 5 of 5

Macro Button to Save as Read Only + Password

  1. #1
    Registered User
    Join Date
    09-19-2010
    Location
    Timbuktu
    MS-Off Ver
    Excel 2007
    Posts
    3

    Cool Macro Button to Save as Read Only + Password

    Hello All,

    I was wondering if it's possible to design an excel template where there is a button.

    And when I click the button, the file is saved as read only with a secret password that only I know. Prefable with date time noted somewhere in the file or as the file name.

    Basically I want to create templates that my staff can enter data but be able to edit after saving.

    Is such a thing possible?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro Button to Save as Read Only + Password

    Try this code, amend it to suit' MyWorkbook is the file name, secret is the password
    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-19-2010
    Location
    Timbuktu
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro Button to Save as Read Only + Password

    Quote Originally Posted by royUK View Post
    Try this code, amend it to suit' MyWorkbook is the file name, secret is the password
    Please Login or Register  to view this content.
    Wow thanks for the prompt reply. Would it also be possible to have the date & time in the file name?
    Perhaps also to have the date and time in the sheet also?

    Umm...I forgot to mention that Im new at excel.
    I just know how to record a macro and assign it to a button.

    Where to I put this code and assign it to a button?
    Sorry for not mentioning earlier that im new
    Last edited by Hirani; 09-19-2010 at 12:15 PM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro Button to Save as Read Only + Password

    The date is already in the file name, to add the time use this
    Please Login or Register  to view this content.
    See Add a button

    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

  5. #5
    Registered User
    Join Date
    09-19-2010
    Location
    Timbuktu
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro Button to Save as Read Only + Password

    Ok I figured it out how to assign it to a button. The file get saved and when I try to open it, excel asks me for a password. I enter the password to open the file but then excel asks me or another password for read and write access. When I enter the same password, excel says it's incorrect. So now I'm only able to open as read only. What am I doing wrong here if I want to edit?

+ 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