XL97: Error Using "Mailto:" with FollowHyperlink Method

Last reviewed: March 13, 1998
Article 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. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

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 : xlvbainfo offinterop
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 13, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.