+ Reply to Thread
Results 1 to 8 of 8

delete hyperlinks from graphical objects in excel sheet

  1. #1
    v_gyku
    Guest

    delete hyperlinks from graphical objects in excel sheet


    I am trying this coe :


    Code:
    --------------------

    ActiveSheet.Shapes("Organization Chart").Select
    Set Shp = Selection.ShapeRange




    For i = 1 To Shp.DiagramNode.Diagram.Nodes.Count
    Set IShp = Shp.DiagramNode.Diagram.Nodes(i).Shape
    On Error Resume Next
    If IShp.Hyperlink.Address <> "" Then
    IShp.Hyperlink.Delete
    End If
    On Error GoTo 0
    Next i

    --------------------


    --
    v_gyku
    ------------------------------------------------------------------------
    v_gyku's Profile: http://www.msusenet.com/member.php?userid=5213
    View this thread: http://www.msusenet.com/t-1871070806


  2. #2
    Dave Peterson
    Guest

    Re: delete hyperlinks from graphical objects in excel sheet

    I put a rectangle on a worksheet and this worked ok:

    Option Explicit
    Sub testme()

    Dim myShape As Shape
    Set myShape = Worksheets("sheet1").Shapes("rectangle 1")

    On Error Resume Next
    myShape.Hyperlink.Delete
    On Error GoTo 0

    End Sub

    v_gyku wrote:
    >
    > I am trying this coe :
    >
    > Code:
    > --------------------
    >
    > ActiveSheet.Shapes("Organization Chart").Select
    > Set Shp = Selection.ShapeRange
    >
    >
    >
    >
    > For i = 1 To Shp.DiagramNode.Diagram.Nodes.Count
    > Set IShp = Shp.DiagramNode.Diagram.Nodes(i).Shape
    > On Error Resume Next
    > If IShp.Hyperlink.Address <> "" Then
    > IShp.Hyperlink.Delete
    > End If
    > On Error GoTo 0
    > Next i
    >
    > --------------------
    >
    > --
    > v_gyku
    > ------------------------------------------------------------------------
    > v_gyku's Profile: http://www.msusenet.com/member.php?userid=5213
    > View this thread: http://www.msusenet.com/t-1871070806


    --

    Dave Peterson

  3. #3
    v_gyku
    Guest

    Re: delete hyperlinks from graphical objects in excel sheet

    Hi Dave !
    I want to tell u somthn.Sorry but I have not mentioned it in the last
    post.
    Its working fine for rectngles.Not wotking for organization charts.

    I give you the code i have written:

    Dim objexcel As Excel.Application
    Dim objworksheet As Excel.Worksheet
    Dim objworkbook As Excel.Workbooks

    Private Sub cmddelete_Click()
    Set objexcel = CreateObject("Excel.Application")
    objexcel.Workbooks.Open ("c:\test hyper.xls")
    objexcel.WindowState = xlMinimized
    objexcel.WindowState = xlMaximized


    Dim Shp As Excel.ShapeRange
    Dim IShp As Excel.Shape
    Dim i As Integer
    Dim j As Integer
    On Error GoTo ResNextShp


    For j = 1 To objexcel.ActiveSheet.Shapes.Count

    objexcel.ActiveSheet.Shapes(j).Select
    Set Shp = Selection.ShapeRange
    If Shp.HasDiagramNode = msoTrue Then
    For i = 1 To Shp.DiagramNode.Diagram.Nodes.Count
    Set IShp = Shp.DiagramNode.Diagram.Nodes(i).Shape
    If IShp.Hyperlink.Address <> "" Then
    IShp.Hyperlink.Delete
    End If
    Next i
    End If
    Set IShp = objexcel.ActiveSheet.Shapes(j)
    If IShp.Hyperlink.Address <> "" Then
    IShp.Hyperlink.Delete
    End If
    Next j
    i = 0

    For i = objexcel.ActiveSheet.Hyperlinks.Count To 1 Step -1
    objexcel.ActiveSheet.Hyperlinks(i).Delete
    Next i

    Exit Sub

    ResNextShp:
    Resume Next

    End Sub


  4. #4
    Registered User
    Join Date
    09-22-2005
    Posts
    7
    I have attached my project here.
    Its just opening exel file and removing hyperlinks in it.
    But it's not removing links from organization chart...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-22-2005
    Posts
    7
    Hey guys none of you have solution for this problem?

    I have seacrched a lot and tried also.. but can't get to it?

    noone have given for organization chart or cycle chart...

    If anyone has pls let me know....

    Thanks...

  6. #6
    Dave Peterson
    Guest

    Re: delete hyperlinks from graphical objects in excel sheet

    I don't connect through excelforum, so I can't see your attachment.

    And I don't open attachments.

    Maybe someone else will chime in.

    v_gyku wrote:
    >
    > I have attached my project here.
    > Its just opening exel file and removing hyperlinks in it.
    > But it's not removing links from organization chart...
    >
    > +-------------------------------------------------------------------+
    > |Filename: v_gyku_hyperlink.zip |
    > |Download: http://www.excelforum.com/attachment.php?postid=3848 |
    > +-------------------------------------------------------------------+
    >
    > --
    > v_gyku
    > ------------------------------------------------------------------------
    > v_gyku's Profile: http://www.excelforum.com/member.php...o&userid=27469
    > View this thread: http://www.excelforum.com/showthread...hreadid=469577


    --

    Dave Peterson

  7. #7
    v_gyku
    Guest

    Re: delete hyperlinks from graphical objects in excel sheet


    I got this code:
    But not removing hyperlink from organization chart.


    Code:
    --------------------

    Dim objexcel As Excel.Application
    Dim objworksheet As Excel.Worksheet
    Dim objworkbook As Excel.Workbooks

    Private Sub cmddelete_Click()
    Set objexcel = CreateObject("Excel.Application")
    objexcel.Workbooks.Open ("c:\test hyper.xls")
    objexcel.WindowState = xlMinimized
    objexcel.WindowState = xlMaximized


    Dim Shp As Excel.ShapeRange
    Dim IShp As Excel.Shape
    Dim i As Integer
    Dim j As Integer
    On Error GoTo ResNextShp


    For j = 1 To objexcel.ActiveSheet.Shapes.Count

    objexcel.ActiveSheet.Shapes(j).Select
    Set Shp = Selection.ShapeRange
    If Shp.HasDiagramNode = msoTrue Then
    For i = 1 To Shp.DiagramNode.Diagram.Nodes.Count
    Set IShp = Shp.DiagramNode.Diagram.Nodes(i).Shape
    If IShp.Hyperlink.Address <> "" Then
    IShp.Hyperlink.Delete
    End If
    Next i
    End If
    Set IShp = objexcel.ActiveSheet.Shapes(j)
    If IShp.Hyperlink.Address <> "" Then
    IShp.Hyperlink.Delete
    End If
    Next j
    i = 0

    For i = objexcel.ActiveSheet.Hyperlinks.Count To 1 Step -1
    objexcel.ActiveSheet.Hyperlinks(i).Delete
    Next i

    Exit Sub

    ResNextShp:
    Resume Next

    End Sub


    --------------------


    --
    v_gyku
    ------------------------------------------------------------------------
    v_gyku's Profile: http://www.msusenet.com/member.php?userid=5213
    View this thread: http://www.msusenet.com/t-1871070806


  8. #8
    NickHK
    Guest

    Re: delete hyperlinks from graphical objects in excel sheet

    v_gyku,
    According to the Object Browser with Excel 2000, there is no such thing as
    "DiagramNode" for a ShapeRange.
    There are "ShapeNodes" and "Nodes" collections however. Is that what you
    mean ?
    Don't know about later versions.

    If on the other hand, you mean the Organisational Chart that can be inserted
    in a WS, then AFAIK you cannot manipulate the elemets from VBA because they
    not part of Excel.

    NickHK

    "v_gyku" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I am trying this coe :
    >
    >
    > Code:
    > --------------------
    >
    > ActiveSheet.Shapes("Organization Chart").Select
    > Set Shp = Selection.ShapeRange
    >
    >
    >
    >
    > For i = 1 To Shp.DiagramNode.Diagram.Nodes.Count
    > Set IShp = Shp.DiagramNode.Diagram.Nodes(i).Shape
    > On Error Resume Next
    > If IShp.Hyperlink.Address <> "" Then
    > IShp.Hyperlink.Delete
    > End If
    > On Error GoTo 0
    > Next i
    >
    > --------------------
    >
    >
    > --
    > v_gyku
    > ------------------------------------------------------------------------
    > v_gyku's Profile: http://www.msusenet.com/member.php?userid=5213
    > View this thread: http://www.msusenet.com/t-1871070806
    >




+ 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