XL97: Error Using "Mailto:" with FollowHyperlink Method

ID: Q161324


The information in this article applies to:
  • Microsoft Excel 97 for Windows


SYMPTOMS

When you run a Visual Basic for Applications macro in Microsoft Excel 97, you may receive one of the following error messages:

Run-time error '-2146697203 (800c000d)':
Method 'FollowHyperlink' of object '_Workbook' failed
-or-
Run-time error '-2146697203 (800c000d)':
The required Internet protocol is not installed on your computer, or the Internet address you requested may not be valid.
and the macro halts.


CAUSE

This problem occurs when all of the following conditions are true:

  • The macro contains a line of code that executes the FollowHyperlink method.


  • -and-

  • The Address argument of the Hyperlink method refers to an electronic mail (e-mail) address by using "mailto:" (without the quotation marks) followed by the address. For example, you use the following code:
    
          Address:="mailto:cmitchell@maas.com" 


  • -and-

  • You set the ExtraInfo argument of the Hyperlink method to any value. For example, you use the code:
    
          ExtraInfo:="Here's some extra info." 


  • -and-

  • You set the Method argument of the Hyperlink method to the value "msoMethodPost" (without the quotation marks). For example, you use the following command:
    
          Method:=msoMethodPost 



RESOLUTION

To resolve this problem, do not set the value of the Method argument to "msoMethodPost" when the Address argument contains a "mailto:" reference.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem no longer occurs in Microsoft Excel 2000.


MORE INFORMATION

In Microsoft Excel 97, you can use the FollowHyperlink method in a Visual Basic macro when you want to view a document or Web page located either on the Internet or on your local intranet. The Address argument of the FollowHyperlink method allows you to specify what document to view. For example, the following code:


   ActiveWorkbook.FollowHyperlink Address:="http://msnbc.com/" 
displays the MSNBC home Web page.

However, if the Address argument begins with "mailto:" followed by an e-mail address, Microsoft Excel 97 starts your mail client (for example, Microsoft Outlook 97, or Microsoft Exchange) and instructs your mail client to compose a new mail message that is addressed to the specified e-mail address. For example, running this line of code:

   ActiveWorkbook.FollowHyperlink Address:="mailto:cmitchell@maas.com" 
causes your mail client to compose a new mail message that is addressed to cmitchell@maas.com. Note that the new mail message is not sent automatically. You must still click Send to send the message.

If the Address argument refers to an e-mail address, setting the Method argument to msoMethodPost causes one of the error messages described in this article to appear, and the macro halts. For example, the following line of code does not work:

  ActiveWorkbook.FollowHyperlink Address:="mailto:cmitchell@maas.com", _
       ExtraInfo:="Here's the data!", Method:=msoMethodPost 

Additional query words: XL97

Keywords : kbdta KbVBA offinterop
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: November 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.