+ Reply to Thread
Results 1 to 3 of 3

Private, lock together.

  1. #1
    Registered User
    Join Date
    11-19-2007
    Posts
    85

    Private, lock together.

    Hello all,

    Ok, here is the problem. I wrote a code in visual basic, but I want it to be private, so that the name of the macro can't be see when they click the play button. I could do this no problem, just "private macro"

    but... when I put private, it seems that this code

    Worksheets("name").Unprotect Password:="password"

    doesn't work, this code locks the sheets so it can't be alter.

    any idea? i want to put the code private, and lock the sheet.

    thanks,
    Last edited by JohnSeito; 04-29-2008 at 01:03 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Where have you put the code. This works when placed in a Standard Module
    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
    11-19-2007
    Posts
    85
    I put the code in the private model, where the macro I wrote is in. the reason for this is b/c so that when someone click on the macro it runs it, it unlock, unprotect the worksheet, to run the code, then locks it again.


    to do this, this code

    Worksheets("name").Unprotect Password:="password"


    only works on standard, sub, not private.

    i want it to be private code, with the ability to protect and lock the worksheets.

    thanks

+ 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