+ Reply to Thread
Results 1 to 3 of 3

Macros, hyperlinks and protected worksheets

  1. #1
    Registered User
    Join Date
    05-01-2012
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macros, hyperlinks and protected worksheets

    Hello,
    I am using excel 2010. This is my first post, so forgive me if my terminology is off a bit.
    My situation:
    I have a worksheet that contains both locked and unlocked cells. The unlocked cells I am having the user insert hyperlinks to external files. This worksheet also has some macros running. When I go to protect the worksheet, I have the options to allow the user to do many things. I check "select unlocked cells" and "insert hyperlinks" and proceed to protect the worksheet. I am leaving all the cells where I want hyperlinks inserted as "unlocked". All works fine except now that the worksheet is protected, my macros won't run.
    I've done a lot of searching and have found a few ways to allow macros to run on protected worksheets, from entering some VB code on the open command (userinterfaceonly=true) to putting VB code that does the same thing at the beginning of each macro. All of this code unprotects the sheet first and then re-protects the sheet at the end. The problem is that when the code re-protects the worksheet, the options that I previously selected ("select locked cells" and "insert hyperlinks") are no longer selected. It defaults to unchecked.

    So I guess my question boils down to this - can macros be run on a protected worksheet while still allowing users to insert hyperlinks in unlocked cells? How is this done? Can code be inserted that upon re-protecting the worksheet, my protection choices will still be valid?

    Thank you very much for any help.

  2. #2
    Registered User
    Join Date
    12-15-2010
    Location
    Greenville, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Macros, hyperlinks and protected worksheets

    Please Login or Register  to view this content.
    I am hoping this will work for you! I haven't been doing VBA long but this should give you the results you are seeking.

  3. #3
    Registered User
    Join Date
    05-01-2012
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macros, hyperlinks and protected worksheets

    Thanks Decoderman, that is exactly the solution I was looking for and all works great now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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