Help: Show Insert/Edit/Remove Hyperlink Option On Read Only Sheets (Locked)

cbryan15

New Member
Joined
Mar 5, 2013
Messages
24
Hi Excel Geniuses!

I would like to ask some help in resolving this matter. I am almost done doing this Excel project of mine. Each sheets consists of locked and unlocked cells. Whenever someone opens the file, it will automatically change it's interface to read-only, whereas, it will lock all the cells that are protected and remain unlocked all those that are not. I entered this VBA code:

Private Sub Workbook_Open()
For Each ws In Sheets
With ws
.Unprotect Password:="Secret"
.Protect Password:="Secret", UserInterfaceOnly:=True
.EnableOutlining = True
End With
Next ws
End Sub

But the problem is, Excel will not allow me to insert, edit or remove HYPERLINK on the cells that need hyperlink. Can you please help me resolve this thing? Is there a VBA code that I can use to make the hyperlink option enabled if the file is protected?

Thank you very much in advance!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,180
Hi
But the problem is, Excel will not allow me to insert
Who is going to insert hyperlinks, you or the end user? You know the password, so it would just be a matter of unprotecting the sheet.
Anyway, for the record, it can be done with VBA:

Code:
Sub AddHyperLink()
Dim Ad$, Nm$, Tip$
      
Ad = "http://www.startrek.com"
Nm = "Star Trek"
Tip = "Click me"
With Sheet1
    .Protect Password:="secret", UserInterFaceOnly:=True
    .Hyperlinks.Add Anchor:=.Range("d4"), Address:=Ad, ScreenTip:=Tip, TextToDisplay:=Nm
End With


End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,516
Messages
5,832,205
Members
430,115
Latest member
RainerJonker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top