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!
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,096
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,569
Messages
5,596,915
Members
414,110
Latest member
docops

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