+ Reply to Thread
Results 1 to 11 of 11

protecting a workbook but still able to run macros

Hybrid View

  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

    Private Sub Workbook_Open()
    Dim wSheet As Worksheet
    
        For Each wSheet In Worksheets
            wSheet.Protect Password:="Secret", _
                UserInterFaceOnly:=True
    
    Next wSheet
    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

+ 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