Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: HYPERLINK Doesn't Work If Second Argument Returns Error


View products that this article applies to.

This article was previously published under Q211501

↑ Back to the top


Symptoms

When you click a hyperlink in a Microsoft Excel worksheet, nothing happens.

↑ Back to the top


Cause

This problem occurs if both of the following conditions are true:
  • You create the hyperlink by using a formula containing the HYPERLINK worksheet function.

    -and-

  • The second argument of the HYPERLINK function, friendly_name, returns an error value, such as #DIV/0!, #NAME?, or #VALUE!

↑ Back to the top


Workaround

To prevent this problem from occurring, make sure that the second argument in the HYPERLINK worksheet function does not return an error value.

For example, assume you are using the following formula:
   =HYPERLINK("http://msnbc.com",A1/B1)
				

Because the expression A1/B1 may return an error value of #DIV/0! if B1 is zero, you must change the second argument so that it does not return an error value. For example, change the sample formula to the following:
   =HYPERLINK("http://msnbc.com",IF(B1=0,0,A1/B1))
				

After you do this, the hyperlink works correctly.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

In Microsoft Excel, the HYPERLINK worksheet function allows you to create a hyperlink in a worksheet cell. The HYPERLINK function accepts the following two arguments:
   Argument        Description
   -------------------------------------------------------------------

   link_location   the path and file name, or URL, you want to link to
   friendly_name   the text that should appear in the cell
				

The friendly_name argument can be a text string, a defined name, or any other expression that returns a value.

If the value of the friendly_name argument returns an error value, the hyperlink does not work when you click it. The following are example formulas that demonstrate this problem.

Example 1: #VALUE! error

The following hyperlink fails because the expression 1+"Alpha" returns a #VALUE! error:

   =HYPERLINK("http://msnbc.com",1+"Alpha")
				

Example 2: #NAME? error

The following hyperlink fails if the defined name "Bravo" doesn't exist, because the second argument returns a #NAME? error:

   =HYPERLINK("http://msnbc.com",Bravo)
				

Example 3: #DIV/0! error

The following hyperlink fails if the mathematical expression returns any kind of error, such as #DIV/0!:
   =HYPERLINK("http://msnbc.com",A1/B1)
				

↑ Back to the top


Keywords: KB211501, kbpending, kbweb, kbbug

↑ Back to the top

Article Info
Article ID : 211501
Revision : 3
Created on : 10/7/2003
Published on : 10/7/2003
Exists online : False
Views : 245