+ Reply to Thread
Results 1 to 9 of 9

hyperlink to another workbook and a specific sheet

  1. #1
    Daniel
    Guest

    hyperlink to another workbook and a specific sheet

    Hello all.
    Is it possible to use VBA to point to another workbook AND a specific sheet
    ?
    There is no problem when the link is used manually. When using VBA, the link
    is only pointing to the "address" part of the link, so you cannot reach the
    sheet and cell you wanted.
    Thanks in advance.
    Daniel



  2. #2
    Tom Ogilvy
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Use the subaddress as well.

    --
    Regards,
    Tom Ogilvy

    "Daniel" <[email protected]> wrote in message
    news:[email protected]...
    > Hello all.
    > Is it possible to use VBA to point to another workbook AND a specific

    sheet
    > ?
    > There is no problem when the link is used manually. When using VBA, the

    link
    > is only pointing to the "address" part of the link, so you cannot reach

    the
    > sheet and cell you wanted.
    > Thanks in advance.
    > Daniel
    >
    >




  3. #3
    Mike
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Try naming the sheet and range in the Hyperlink's SubAddress.

    Mike F
    Daniel <[email protected]> wrote in message
    news:[email protected]...
    > Hello all.
    > Is it possible to use VBA to point to another workbook AND a specific

    sheet
    > ?
    > There is no problem when the link is used manually. When using VBA, the

    link
    > is only pointing to the "address" part of the link, so you cannot reach

    the
    > sheet and cell you wanted.
    > Thanks in advance.
    > Daniel
    >
    >




  4. #4
    Daniel
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Thanks for your answer, it works fine.
    Daniel
    "Mike" <[email protected]> a écrit dans le message de news:
    uHsW%[email protected]...
    > Try naming the sheet and range in the Hyperlink's SubAddress.
    >
    > Mike F
    > Daniel <[email protected]> wrote in message
    > news:[email protected]...
    >> Hello all.
    >> Is it possible to use VBA to point to another workbook AND a specific

    > sheet
    >> ?
    >> There is no problem when the link is used manually. When using VBA, the

    > link
    >> is only pointing to the "address" part of the link, so you cannot reach

    > the
    >> sheet and cell you wanted.
    >> Thanks in advance.
    >> Daniel
    >>
    >>

    >
    >




  5. #5
    Daniel
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Thanks for your response.
    Can you, please, be a little more explicit?
    my code :
    Range("C11").Hyperlinks(1).follow points only to the workbook
    Daniel
    "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > Use the subaddress as well.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Daniel" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hello all.
    >> Is it possible to use VBA to point to another workbook AND a specific

    > sheet
    >> ?
    >> There is no problem when the link is used manually. When using VBA, the

    > link
    >> is only pointing to the "address" part of the link, so you cannot reach

    > the
    >> sheet and cell you wanted.
    >> Thanks in advance.
    >> Daniel
    >>
    >>

    >
    >




  6. #6
    Tom Ogilvy
    Guest

    Re: hyperlink to another workbook and a specific sheet

    I set up a hyperlink that would manually open a workbook and go to a
    specific worksheet and cell.

    Using your code worked fine for me.

    You can examine your hyperlink with code

    Sub TestHyperlink()
    Dim sStr As String
    With Range("C11").Hyperlinks(1)
    sStr = "Address: " & .Address & vbNewLine & _
    "SubAddress: " & .SubAddress
    End With
    MsgBox sStr
    End Sub


    If you don't get a subaddress, then there is your problem.


    --
    Regards,
    Tom Ogilvy


    "Daniel" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for your response.
    > Can you, please, be a little more explicit?
    > my code :
    > Range("C11").Hyperlinks(1).follow points only to the workbook
    > Daniel
    > "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    > [email protected]...
    > > Use the subaddress as well.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Daniel" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> Hello all.
    > >> Is it possible to use VBA to point to another workbook AND a specific

    > > sheet
    > >> ?
    > >> There is no problem when the link is used manually. When using VBA, the

    > > link
    > >> is only pointing to the "address" part of the link, so you cannot reach

    > > the
    > >> sheet and cell you wanted.
    > >> Thanks in advance.
    > >> Daniel
    > >>
    > >>

    > >
    > >

    >
    >




  7. #7
    Daniel
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Yes, you get the address and subaddress correctly. The problem is that the
    "follow" method seems not to use the subaddress property, as long as it is
    refered with sheet and cell name (Feuil1!A2 for instance).
    Daniel
    "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    %[email protected]...
    >I set up a hyperlink that would manually open a workbook and go to a
    > specific worksheet and cell.
    >
    > Using your code worked fine for me.
    >
    > You can examine your hyperlink with code
    >
    > Sub TestHyperlink()
    > Dim sStr As String
    > With Range("C11").Hyperlinks(1)
    > sStr = "Address: " & .Address & vbNewLine & _
    > "SubAddress: " & .SubAddress
    > End With
    > MsgBox sStr
    > End Sub
    >
    >
    > If you don't get a subaddress, then there is your problem.
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Daniel" <[email protected]> wrote in message
    > news:[email protected]...
    >> Thanks for your response.
    >> Can you, please, be a little more explicit?
    >> my code :
    >> Range("C11").Hyperlinks(1).follow points only to the workbook
    >> Daniel
    >> "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    >> [email protected]...
    >> > Use the subaddress as well.
    >> >
    >> > --
    >> > Regards,
    >> > Tom Ogilvy
    >> >
    >> > "Daniel" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> Hello all.
    >> >> Is it possible to use VBA to point to another workbook AND a specific
    >> > sheet
    >> >> ?
    >> >> There is no problem when the link is used manually. When using VBA,
    >> >> the
    >> > link
    >> >> is only pointing to the "address" part of the link, so you cannot
    >> >> reach
    >> > the
    >> >> sheet and cell you wanted.
    >> >> Thanks in advance.
    >> >> Daniel
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  8. #8
    Tom Ogilvy
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Like I said, it worked for me in xl2003.

    If you can't get it to work, then perhaps you would need to use the
    followhyperlink event to achieve the desired result.
    --
    Regards,
    Tom Ogilvy


    "Daniel" <[email protected]> wrote in message
    news:[email protected]...
    > Yes, you get the address and subaddress correctly. The problem is that the
    > "follow" method seems not to use the subaddress property, as long as it is
    > refered with sheet and cell name (Feuil1!A2 for instance).
    > Daniel
    > "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    > %[email protected]...
    > >I set up a hyperlink that would manually open a workbook and go to a
    > > specific worksheet and cell.
    > >
    > > Using your code worked fine for me.
    > >
    > > You can examine your hyperlink with code
    > >
    > > Sub TestHyperlink()
    > > Dim sStr As String
    > > With Range("C11").Hyperlinks(1)
    > > sStr = "Address: " & .Address & vbNewLine & _
    > > "SubAddress: " & .SubAddress
    > > End With
    > > MsgBox sStr
    > > End Sub
    > >
    > >
    > > If you don't get a subaddress, then there is your problem.
    > >
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Daniel" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> Thanks for your response.
    > >> Can you, please, be a little more explicit?
    > >> my code :
    > >> Range("C11").Hyperlinks(1).follow points only to the workbook
    > >> Daniel
    > >> "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    > >> [email protected]...
    > >> > Use the subaddress as well.
    > >> >
    > >> > --
    > >> > Regards,
    > >> > Tom Ogilvy
    > >> >
    > >> > "Daniel" <[email protected]> wrote in message
    > >> > news:[email protected]...
    > >> >> Hello all.
    > >> >> Is it possible to use VBA to point to another workbook AND a

    specific
    > >> > sheet
    > >> >> ?
    > >> >> There is no problem when the link is used manually. When using VBA,
    > >> >> the
    > >> > link
    > >> >> is only pointing to the "address" part of the link, so you cannot
    > >> >> reach
    > >> > the
    > >> >> sheet and cell you wanted.
    > >> >> Thanks in advance.
    > >> >> Daniel
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




  9. #9
    Daniel
    Guest

    Re: hyperlink to another workbook and a specific sheet

    Thanks for all.
    Daniel
    "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > Like I said, it worked for me in xl2003.
    >
    > If you can't get it to work, then perhaps you would need to use the
    > followhyperlink event to achieve the desired result.
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Daniel" <[email protected]> wrote in message
    > news:[email protected]...
    >> Yes, you get the address and subaddress correctly. The problem is that
    >> the
    >> "follow" method seems not to use the subaddress property, as long as it
    >> is
    >> refered with sheet and cell name (Feuil1!A2 for instance).
    >> Daniel
    >> "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    >> %[email protected]...
    >> >I set up a hyperlink that would manually open a workbook and go to a
    >> > specific worksheet and cell.
    >> >
    >> > Using your code worked fine for me.
    >> >
    >> > You can examine your hyperlink with code
    >> >
    >> > Sub TestHyperlink()
    >> > Dim sStr As String
    >> > With Range("C11").Hyperlinks(1)
    >> > sStr = "Address: " & .Address & vbNewLine & _
    >> > "SubAddress: " & .SubAddress
    >> > End With
    >> > MsgBox sStr
    >> > End Sub
    >> >
    >> >
    >> > If you don't get a subaddress, then there is your problem.
    >> >
    >> >
    >> > --
    >> > Regards,
    >> > Tom Ogilvy
    >> >
    >> >
    >> > "Daniel" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> Thanks for your response.
    >> >> Can you, please, be a little more explicit?
    >> >> my code :
    >> >> Range("C11").Hyperlinks(1).follow points only to the workbook
    >> >> Daniel
    >> >> "Tom Ogilvy" <[email protected]> a écrit dans le message de news:
    >> >> [email protected]...
    >> >> > Use the subaddress as well.
    >> >> >
    >> >> > --
    >> >> > Regards,
    >> >> > Tom Ogilvy
    >> >> >
    >> >> > "Daniel" <[email protected]> wrote in message
    >> >> > news:[email protected]...
    >> >> >> Hello all.
    >> >> >> Is it possible to use VBA to point to another workbook AND a

    > specific
    >> >> > sheet
    >> >> >> ?
    >> >> >> There is no problem when the link is used manually. When using VBA,
    >> >> >> the
    >> >> > link
    >> >> >> is only pointing to the "address" part of the link, so you cannot
    >> >> >> reach
    >> >> > the
    >> >> >> sheet and cell you wanted.
    >> >> >> Thanks in advance.
    >> >> >> Daniel
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




+ 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