+ Reply to Thread
Results 1 to 11 of 11

protecting a workbook but still able to run macros

  1. #1
    Registered User
    Join Date
    12-29-2005
    Posts
    90

    protecting a workbook but still able to run macros

    is it possible to protect a workbook but still run various macros, i have tried this and the macros wont run

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See link

    http://www.ozgrid.com/VBA/excel-macr...cted-sheet.htm

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    this is the code found at that location, works brilliantly thanks but is the anything i can add in so that the user can still right click and insert comments in the cells

    Please Login or Register  to view this content.
    End Sub
    Last edited by royUK; 03-24-2008 at 03:23 AM.

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

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

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    that was almost exactly what i wanted, i still needed to do a bit more research and messing around to get it working right but have now got exactly the workbook result i needed

    thank you

  6. #6
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    is there a way to change the password in this macro, every time i try i get an error message saying i've entered the wrong password. i tried changing the code and putting it in a new workbook and it worked ok, but it wont let me change it in an existing workbook

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

  8. #8
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    this macro. hope you can help


    Please Login or Register  to view this content.
    Last edited by VBA Noob; 06-15-2008 at 03:20 PM.

  9. #9
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    managed a workaround by creating a new workbook and copying all the sheets from the old one with protection turned off, then re-applying the macro with a new password on the new sheet, needed quite a bit of work but problem solved. thanks. would still love to know why i couldnt just change the password on the original workbook though, it's a puzzle

  10. #10
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121
    This is a great bit of code. Is it possible to hide the password in the code or prevent them going into it, as want to prevent users from unprotecting the work sheet?

    Thanks
    Harry

  11. #11
    Registered User
    Join Date
    12-29-2005
    Posts
    90

    Re: protecting a workbook but still able to run macros

    havent found a way to hide the password but if you go to the vba editor, click on tools, VBAprojectproperties and select the protection tab. tick the "lock for viewing" box and enter the same password, no one without the password can see or change the macros, including the protection. works perfectly

+ 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