+ Reply to Thread
Results 1 to 5 of 5

How to protect desired area of workbook and protect code.

  1. #1
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346

    How to protect desired area of workbook and protect code.

    I have created a small game with a worksheet displaying different colors etc. in different cells and a few buttons on the sheet. Buttons have their codes associated with them in the modules. Player has to choose some cells, enter some data only in some particular cells marked for the purpose and then click a button. This is very simple. I want someone to tell me how I can save this workbook with all its associated macros etc so that I can give a copy to anyone who can play the game but cannot access the code, cannot change the format of the main sheet or cannot change/edit any cell he is not required to and enter only those cells to which access is required. I know this must be very elementary but I am not able to achieve this. I work with XP and EXCEL2000. I have seen simple quizzes in EXCEL where we have to give correct answers in a particular column and it gives you score for correct answer. Except the particular column the whole sheet is protected. You cannot edit any other cell nor you can access the codes.

    A V Veerkar

  2. #2
    Dave Peterson
    Guest

    Re: How to protect desired area of workbook and protect code.

    You can protect the project within the VBE.
    Tools|VBAProject Properties|Protection tab
    give it a memorable password.

    You can protect worksheets within excel.
    tools|protection|protect sheet

    Be aware that this kind of protection is easily broken--but it's the best you
    can do if you stay within excel.

    avveerkar wrote:
    >
    > I have created a small game with a worksheet displaying different colors
    > etc. in different cells and a few buttons on the sheet. Buttons have
    > their codes associated with them in the modules. Player has to choose
    > some cells, enter some data only in some particular cells marked for
    > the purpose and then click a button. This is very simple. I want
    > someone to tell me how I can save this workbook with all its associated
    > macros etc so that I can give a copy to anyone who can play the game but
    > cannot access the code, cannot change the format of the main sheet or
    > cannot change/edit any cell he is not required to and enter only those
    > cells to which access is required. I know this must be very elementary
    > but I am not able to achieve this. I work with XP and EXCEL2000. I have
    > seen simple quizzes in EXCEL where we have to give correct answers in a
    > particular column and it gives you score for correct answer. Except the
    > particular column the whole sheet is protected. You cannot edit any
    > other cell nor you can access the codes.
    >
    > A V Veerkar
    >
    > --
    > avveerkar
    > ------------------------------------------------------------------------
    > avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
    > View this thread: http://www.excelforum.com/showthread...hreadid=500506


    --

    Dave Peterson

  3. #3
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Quote Originally Posted by Dave Peterson
    You can protect the project within the VBE.
    Tools|VBAProject Properties|Protection tab
    give it a memorable password.

    You can protect worksheets within excel.
    tools|protection|protect sheet

    Be aware that this kind of protection is easily broken--but it's the best you
    can do if you stay within excel.

    Dave Peterson
    Thanks Dave but this doesn't help. If I protect the sheet I cannot modify any cell manually or by macros which my game needs to do. If I "unlock" the cells ( which I want to write through macros or manually as required by the game ) before I protect the sheet, I am only allowed to change the contents of the "unlocked" cells but not formatting etc. I need full access to change contents, formatting. In brief, all the cells on the sheet which are not required to be changed while playing the game should be fully locked but all the cells which get modified by macros or by the player should be fully accessible for changing values as well as formatting.

    Thanks
    A V Veerkar

  4. #4
    Dave Peterson
    Guest

    Re: How to protect desired area of workbook and protect code.

    xl2002 offered a lot more options when the worksheet is protected--you can allow
    formatting changes, insertion/deletion of rows/columns. xl2002+ gives you much
    more control.

    If you're using xl2k or below, the most common suggestion would be to give the
    users a set of macros that allow them to do only what you want. Your macros can
    unprotect the sheet, do the work, and reprotect the sheet.



    avveerkar wrote:
    >
    > Dave Peterson Wrote:
    > > You can protect the project within the VBE.
    > > Tools|VBAProject Properties|Protection tab
    > > give it a memorable password.
    > >
    > > You can protect worksheets within excel.
    > > tools|protection|protect sheet
    > >
    > > Be aware that this kind of protection is easily broken--but it's the
    > > best you
    > > can do if you stay within excel.
    > >
    > > Dave Peterson

    >
    > Thanks Dave but this doesn't help. If I protect the sheet I cannot
    > modify any cell manually or by macros which my game needs to do. If I
    > "unlock" the cells ( which I want to write through macros or manually
    > as required by the game ) before I protect the sheet, I am only allowed
    > to change the contents of the "unlocked" cells but not formatting etc. I
    > need full access to change contents, formatting. In brief, all the cells
    > on the sheet which are not required to be changed while playing the game
    > should be fully locked but all the cells which get modified by macros or
    > by the player should be fully accessible for changing values as well as
    > formatting.
    >
    > Thanks
    > A V Veerkar
    >
    > --
    > avveerkar
    > ------------------------------------------------------------------------
    > avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
    > View this thread: http://www.excelforum.com/showthread...hreadid=500506


    --

    Dave Peterson

  5. #5
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    [QUOTE=Dave Peterson]xl2002 offered a lot more options when the worksheet is protected--you can allow
    formatting changes, insertion/deletion of rows/columns. xl2002+ gives you much
    more control.

    If you're using xl2k or below, the most common suggestion would be to give the
    users a set of macros that allow them to do only what you want. Your macros can
    unprotect the sheet, do the work, and reprotect the sheet.


    Thanks. That is a good suggestion. Control access through Macros. Protect and unprotect whenever you want it. I will work along those lines.

    A V Veerkar

+ 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