+ Reply to Thread
Results 1 to 7 of 7

to click on a cell and go to named local HTML file

  1. #1

    to click on a cell and go to named local HTML file

    Hi There

    Can anyone help me with the code required to display the local HTML
    file named in the selected (clicked on) cell?

    I do not want a button. I just want the user to be presented with the
    HTML file that they are working on, after clicking on a cell.

    Would really appreciate your help. I am using 2002.

    Regards
    Geoff


  2. #2
    Jim Cone
    Guest

    Re: to click on a cell and go to named local HTML file

    Geoff,
    Maybe this...
    '------------
    Sub ClickAndGo()
    Dim strPath As String
    Dim strName As String

    strName = "readme.html"
    strPath = "C:\Program Files\Zone Labs\ZoneAlarm\readme.html"
    Range("B7").Value = "=Hyperlink(""" & strPath & """,""" & strName & """)"
    End Sub
    '------------

    Jim Cone
    San Francisco, USA


    <[email protected]>
    wrote in message
    news:[email protected]
    Hi There
    Can anyone help me with the code required to display the local HTML
    file named in the selected (clicked on) cell?
    I do not want a button. I just want the user to be presented with the
    HTML file that they are working on, after clicking on a cell.
    Would really appreciate your help. I am using 2002.
    Regards
    Geoff


  3. #3

    Re: to click on a cell and go to named local HTML file

    Jim

    I can't thank you enough for your assistance here, but.. I think that I
    have not been very clear in my request, so I will try again.

    I have developed a worksheet that builds the rows of a table in a web
    page.
    The idea is then for the user to double click on a specific and user
    editable cell on the worksheet, to which a macro is attached, and then
    bring up the web page for editing and renewing the rows in the table.

    The path should not be neccessary because the target web page resides
    in the same directory as the workbook.

    There will be about 8 of these specific cells so a macro is required
    for each one. Each macro needs to be "double click" because the user
    needs to be able to edit the cell.

    Hope that is a lot clearer.

    Geoff


  4. #4
    Jim Cone
    Guest

    Re: to click on a cell and go to named local HTML file

    Geoff,

    Code similar to the following placed in the worksheet module
    should get the job done for you...
    '-------------
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.Address = "$B$7" Then
    Workbooks.Open Filename:=ThisWorkbook.Path & "\readme.html"
    Cancel = True
    End If
    End Sub
    '--------------

    Regards,
    Jim Cone
    San Francisco, USA


    <[email protected]> wrote in message
    news:[email protected]...
    Jim
    I can't thank you enough for your assistance here, but.. I think that I
    have not been very clear in my request, so I will try again.
    I have developed a worksheet that builds the rows of a table in a web
    page.
    The idea is then for the user to double click on a specific and user
    editable cell on the worksheet, to which a macro is attached, and then
    bring up the web page for editing and renewing the rows in the table.
    The path should not be neccessary because the target web page resides
    in the same directory as the workbook.
    There will be about 8 of these specific cells so a macro is required
    for each one. Each macro needs to be "double click" because the user
    needs to be able to edit the cell.
    Hope that is a lot clearer.
    Geoff


  5. #5

    Re: to click on a cell and go to named local HTML file

    Thanks Jim
    We're nearly there.

    The changes I made to your suggestion are shown in the following code:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
    As Boolean)
    If Target.Address = "$K$2" Then
    Workbooks.Open Filename:=ThisWorkbook.Path & "\" & Range("K2").Value
    Cancel = True
    End If
    End Sub

    It works a real treat, but with one small problem!

    It finds the file fine, but creates another workbook and puts the file
    in there.

    I would like it to display the web page in much the same way that
    any other web page is dispalyed when you click on a link or url.

    Geoff


  6. #6
    Jim Cone
    Guest

    Re: to click on a cell and go to named local HTML file

    Geoff,

    You can change...
    Workbooks.Open _
    Filename:=ThisWorkbook.Path & "\" & Range("K2").Value
    To...
    ActiveWorkbook.FollowHyperlink _
    Address:=ThisWorkbook.Path & "\" & Range("K2").Value

    Regards,
    Jim Cone
    San Francisco, USA



    <[email protected]>
    wrote in message
    news:[email protected]
    Thanks Jim
    We're nearly there.
    The changes I made to your suggestion are shown in the following code:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
    As Boolean)
    If Target.Address = "$K$2" Then
    Workbooks.Open Filename:=ThisWorkbook.Path & "\" & Range("K2").Value
    Cancel = True
    End If
    End Sub

    It works a real treat, but with one small problem!
    It finds the file fine, but creates another workbook and puts the file
    in there.
    I would like it to display the web page in much the same way that
    any other web page is dispalyed when you click on a link or url.
    Geoff


  7. #7

    Re: to click on a cell and go to named local HTML file

    Jim

    Spot on.... Thank you very much for your time.

    Really appreciated

    Geoff


+ 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