Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Feb 2005
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    FollowHyperlink uses Win Explorer in Error (XP Excel 2003)

    On a number of computers I've linked IrfanView as the application to open images. It says so on the Folder Options / File Types Windows panel and double click on an Icon always works. But I've also used Visual Basic ActiveWorkbook.FollowHyperlink to open images. On most of those computers it works fine but on some of them it insists on using Internet Explorer. A few have subsequently converted to opening with the required IrfanView. I'm not aware of having done anything specific to make that change. All other linked applicatIons (Excel, Word, Media Players etc) work fine. I can't understand what to do and am frustrated. I'd really appreciate any assistance to resolve this problem.

    regards

    Geoffrey Howell

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: FollowHyperlink uses Win Explorer in Error (XP Excel 2003)

    I don't have an explanation, but you might try ShellExecute instead of FollowHyperlink. I can't guarantee that it will work better than FollowHyperlink, but it's worth a try. See the thread starting at <post:=254,691>post 254,691</post:> for an example.

  3. #3
    Star Lounger
    Join Date
    Feb 2005
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: FollowHyperlink uses Win Explorer in Error (XP

    Hans,

    Thank you very much. It works and that's so encouraging. But I need to put this into a function and I've written the following code in place of your macro (leaving your lines prior to your macro in place).

    Function ZFileOpenA( _
    MyFile As String, _
    MyDir As String)
    Dim lngResult As Long
    Dim strTarget As String
    strTarget = ZFileJoinPath(MyFile, MyDir)
    lngResult = ShellExecute(0&, "Open", _
    strTarget, 0&, 0&, SW_SHOWMAXIMIZED)
    If lngResult <= 32 Then
    ZFileOpenA = "Undefined Error"
    Exit Function
    End If
    ZFileOpenA = True
    End Function

    Unfortunately it bombs out on the Function line and I am really out of my depth. (Previously and with your help I've now got functions that Open, Copy, Move and Delete any file and I can access these functions in XLM Macro 4). If I can get this section working then I should have a reliable suite of functions. I'm sure I've done something wrong that's very obvious. Any help would be appreciated.

    regards

    Geoffrey

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: FollowHyperlink uses Win Explorer in Error (XP

    You'll have to tell us what error message you get.
    I made a reasonable guess at what ZFileJoinPath does, and put it into a module together with your function. The Test procedure in the attached demo calls ZFileOpenA with the path and filename of a file on my hard disk, and it works OK.
    Attached Files Attached Files

  5. #5
    Star Lounger
    Join Date
    Feb 2005
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: FollowHyperlink uses Win Explorer in Error (XP

    Hans,

    Thank you so much. I've updated my Visual Basic functions into my ZMacros suite and modified the XLM Macros slightly. In the applications above that it's just adding in the "A" onto the "Open". It all works fine now thanks to you. Your work is truly excellent, and I appreciate it very much.

    regards

    Geoffrey

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FollowHyperlink uses Win Explorer in Error (XP Excel 2003)

    Sometimes this helps too:

    Open Explorer
    - Tools, folder options
    - File types tab
    - locate the files you have trouble with
    - select the extension and click advanced
    - uncheck browse in same window.

    This also solves Office files opening in an internet explorer window after clicking on a hyperlink on a site.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •