+ Reply to Thread
Results 1 to 2 of 2

Protect Cells But Allow Macros?

  1. #1
    Registered User
    Join Date
    10-08-2006
    Posts
    68

    Protect Cells But Allow Macros?

    Hello,
    While playing around with macros I'm getting errors when I try to protect the workbook. It's saying
    Runtime error '1004'
    "Unable to set the hidden property of the Range class"
    The macro is opening hidden cells. Is there a way to protect all the cells except the cells that I want the users to use and still allow the macros?
    Thanks for your help.
    Nate

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    In your macro code, you can add a line at the beginning to turn off password protection, then at the end to turn it back on:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Since your password will be in plain text in the macro code, you should probably password protect the vba module from being viewed (in the vba window, click on Tools --> VBA Project Properties --> Protection)

+ 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