1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

FollowHyperlink Warning Message

Discussion in 'Business Applications' started by curtswanson, Sep 7, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. curtswanson

    curtswanson Thread Starter

    Joined:
    Jun 22, 2000
    Messages:
    41
    in Excel 2003, I'm trying to use the FollowHyperlink method but it provides a warning message "Hyperlinks can be harmful to your computer and data...". I have not been successful eliminating this message.

    Suggestions appreciated.

    My code:

    Sub CallFollowHyperlink()
    Application.DisplayAlerts = False
    ActiveWorkbook.FollowHyperlink "C:\Report Launcher\Turns.ppt"
    End Sub
     
  2. Kelly_in_LA

    Kelly_in_LA

    Joined:
    Jun 16, 2004
    Messages:
    47
    I have Excel 2000, so I don't know if my comparison is valid, but when I run your code, I do not get a warning message even WITHOUT setting DisplayAlerts to False.

    Are you sure the warning message is coming from Excel? I am wondering if it isn't coming from some type of anti-virus software or from some security settings at the level of the operating system. Because if the warning is coming from elsewhere than Excel, then the DisplayAlerts probably won't help. (For example, when I run any scripts using the Windows Scripting Host, my version of Norton Antivirus automatically warns me that an attempt is being made to run a script on my machine and do I want to continue or not)
     
  3. bill.aam

    bill.aam

    Joined:
    Apr 29, 2004
    Messages:
    7,218
  4. Kelly_in_LA

    Kelly_in_LA

    Joined:
    Jun 16, 2004
    Messages:
    47
    Okay, I have a follow-up comment now. When I said this:

    when I run your code, I do not get a warning message even WITHOUT setting DisplayAlerts to False.


    I guess I spoke to soon. It would now be correct to say that when I run your code WHILE REPLACING YOUR Turns.ppt FILE ADDRESS with the address for a plain old TXT file, I do not get the error. However, when I use the file address for a VBS file on my desktop, I do get the warning. It looks like this:

    [​IMG]
    (the above image is stored at http://members.dslextreme.com/users/kkj/vbax_special/securitywarning.gif)

    So I guess windows is smart enough to realize when you are opening a harmless txt file and when the file could potentially be something that contains macros.

    As you can see, the security warning says "Microsoft Office" in the caption. So it is not coming from Excel. that's why DisplayAlerts won't help.

    -Kelly
     
  5. Kelly_in_LA

    Kelly_in_LA

    Joined:
    Jun 16, 2004
    Messages:
    47
    That's awesome, Bill! Once I realized the message was from Office I was about to go digging for some sort of settings tweak, but you already had it!
     
  6. curtswanson

    curtswanson Thread Starter

    Joined:
    Jun 22, 2000
    Messages:
    41
    Thanks for the responses. The MS article is a drag because this code is intended for an add-in that I supply to many of my co-workers around the world, all running different OSes and different versions of Office. It doesn't seem practical to suggest Registry tweaks for them.
     
  7. Kelly_in_LA

    Kelly_in_LA

    Joined:
    Jun 16, 2004
    Messages:
    47
    Since the file specified in your FollowHyperlink is a PowerPoint file, why not use Visual Basic (VBA) to automate PowerPoint from within your Excel macro? did you know PowerPoint supports VBA macros and automation and all of that, too?

    I have not automated PowerPoint from Excel, but I have called on Excel from within a VBA macro in AutoCAD, so I know that this can be done.

    I think it would be something like:

    Code:
    [SIZE=2]Dim myPowerPoint as PowerPoint.Application
    Set myPowerPoint = New PowerPoint.Application
    myPowerPoint.Presentations.Open "C:\Report Launcher\Turns.ppt"[/SIZE]
    Also, make sure to add a reference in your Excel project to the POWERPOINT LIBRARY. (choose Tools-->References in the VB Editor and put a check in the check box for Microsoft PowerPoint)

    [that part is important. could you tell by the bold font?]

    when you add the reference, that will be a part of your project. When you distribute it, each user should NOT have to go manually add a reference to powerpoint.

    Forgive me if I'm giving you a "lesson" on something that you already know how to do. Have you tried to create a PowerPoint.Application object in your excel code? Do you think it would work for what you're trying to do?

    Kelly
     
  8. Kelly_in_LA

    Kelly_in_LA

    Joined:
    Jun 16, 2004
    Messages:
    47
  9. curtswanson

    curtswanson Thread Starter

    Joined:
    Jun 22, 2000
    Messages:
    41
    Thanks. That is what I'm currently doing. This is for a "report launcher" addin to Excel that I've created for many of my co-workers. It lets them open many different file types from an Excel menu. I was hoping to be able to use a "generic" method for launching a file in its native application without having to handle each file type individually.
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - FollowHyperlink Warning Message
  1. flavallee
    Replies:
    1
    Views:
    328
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/271257

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice