Remove hyperlink from pictures

Deepk

Board Regular
Joined
Mar 21, 2018
Messages
105
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I want a macro that remove hyperlink from all the pictures in an excel worksheet. Please help me. Thank you.

Regards,
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Select the picture and press "Ctrl + A". This will select all shapes. Keep the selection and go to VB Screen and then go to immediate window (Ctrl +G). Paste the below code and press enter

Code:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Selection.Hyperlinks.Delete</code>
 
Last edited:
Upvote 0
Select the picture and press "Ctrl + A". This will select all shapes. Keep the selection and go to VB Screen and then go to immediate window (Ctrl +G). Paste the below code and press enter

Code:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Selection.Hyperlinks.Delete</code>

Thank you for your reply. based on you input I am running the following code

Sub hyper ()
ActiveSheet.Pictures.Select
Selection.Hyperlinks.Delete
End Sub

But at Selection.Hyperlinks.Delete it is showing an Run time error 438, "Object does not support this property or method"

Please suggest. Thank you.
 
Upvote 0
It appears you treat the pictures as shapes. The following code will remove all hyperlinks from SHAPES, including pictures, on the current Worksheet

Code:
Sub hyper()
    Dim shp As Shape
    For Each shp In ActiveSheet.Shapes
        If shp.Hyperlink.Address <> "" Then shp.Hyperlink.Delete
    Next shp
End Sub
 
Upvote 0
It appears you treat the pictures as shapes. The following code will remove all hyperlinks from SHAPES, including pictures, on the current Worksheet

Code:
Sub hyper()
    Dim shp As Shape
    For Each shp In ActiveSheet.Shapes
        If shp.Hyperlink.Address <> "" Then shp.Hyperlink.Delete
    Next shp
End Sub


Thank you Stiuart_W. Have a good day.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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
Back
Top